The Messenger of Allah (ﷺ) said: "When any one of you gets up and prays, the Shaitan comes…

Sunan an-Nasa'i Book 13 Hadith 74

Sunan an-Nasa'i #1252

The Book of Forgetfulness (In Prayer) 13:74

It was narrated from Abu Hurairah that:

The Messenger of Allah (ﷺ) said: "When any one of you gets up and prays, the Shaitan comes to him an confuses him until he does not know how many (Rak'ahs) he prayed. If any one of you notices that, let him prostrate twice when he is sitting."

Chapter: Estimating (what is most likely the case)

Grade: Sahih (Darussalam)