The Messenger of Allah ﷺ said, "When the call to prayer is made, Satan turns and flees, breaking wind as he goes. Once the call is finished, he returns and slips between a man and his heart, until he no longer knows how much he has prayed. When any of you experiences this, let him perform two prostrations."
أخبرنا بشر بن هلال قال حدثنا عبد الوارث عن هشام الدستوائي عن يحيى بن أبي كثير عن أبي سلمة
قال رسول الله ﷺ إذا نودي للصلاة أدبر الشيطان له ضراط فإذا قضي التثويب أقبل حتى يخطر بين المرء وقلبه حتى لا يدري كم صلى فإذا رأى أحدكم ذلك فليسجد سجدتين
[Sahih] Bukhari transmitted it in the Book of Forgetfulness, chapter, "If One Does Not Know Whether One Prayed Three or Four Units," etc., hadith no. 1231, and Muslim, in the Book of Mosques, chapter on forgetfulness in prayer and the sujud for it, hadith no. 83/389, from the hadith of Hisham Dastawai, and it is in Al-Kubra, hadith no. 1176.