Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Satan comes to one of you in his prayer and throws him into doubt about his prayer, until the worshipper does not know how much he has prayed. So when that happens to any of you, let him perform two prostrations while sitting."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3828