The Prophet (pbuh) said: If any one of you gets up to pray, the Shaytan comes and confuses him ie mixes up his prayer and creates doubts in this mind - so that he does not know how many [rak'ahs] he has prayed, he should do two prostrations whilst he is sitting. (Bukhari)