Abu Hurairah reported,

The Messenger of Allah ﷺ said, "When one of you stands to pray, Satan comes to him and confuses him until he does not know how many units he has prayed. When any of you experiences that, let him perform two prostrations while seated."

Abu Dawud 1030

Sahih

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

عن أبي هريرة

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

أبو داود 1030صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Prayer
Chapter
Whoever says one should complete the prayer based on their predominant assumption
Numbering
Darussalam 1030
Abu Dawud 1030