Abu Hurairah reported,

He told them that the Messenger of Allah ﷺ said, "When the call to prayer is made, Satan turns away, breaking wind loudly so as not to hear the adhan. When the adhan is finished, he returns. When the iqamah is called, he turns away again, and when the iqamah is completed, he returns and slips between a man and his own self, telling him, 'Remember this, remember that,' bringing to mind things he had not been thinking of, until the man no longer knows how much he has prayed. So if any of you does not know how much he has prayed, let him perform two prostrations while seated."

Muslim 1267

Sahih

حدثنا محمد بن المثنى حدثنا معاذ بن هشام حدثني أبي عن يحيى بن أبي كثير حدثنا أبو سلمة بن عبد الرحمن أن

أبا هريرة

حدثهم أن رسول الله ﷺ قال إذا نودي بالأذان أدبر الشيطان له ضراط حتى لا يسمع الأذان فإذا قضي الأذان أقبل فإذا ثوب بها أدبر فإذا قضي التثويب أقبل يخطر بين المرء ونفسه يقول اذكر كذا اذكر كذا لما لم يكن يذكر حتى يظل الرجل إن يدري كم صلى فإذا لم يدر أحدكم كم صلى فليسجد سجدتين وهو جالس

مسلم 1267صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Forgetfulness in prayer and sujud for it
Numbering
Darussalam 1267
Muslim 1267