Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Satan comes to one of you during his prayer and confuses him until he does not know how many units he has prayed. When one of you finds himself in this state, let him perform two prostrations while seated."

Tirmidhi 397

Sahih

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

عن أبي هريرة قال

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

الترمذي 397صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Prayer
Chapter
Man who prays and is uncertain about addition or omission
Numbering
Darussalam 397
Tirmidhi 397