The Messenger of Allah ﷺ said: When any one of you stands up to pray, the devil comes to him and confuses him to that he does not know how much he has prayed. If any one of you has such an experience he should perform two prostrations while sitting down (in qa'da).
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِنَّ أَحَدَكُمْ إِذَا قَامَ يُصَلِّي جَاءَهُ الشَّيْطَانُ فَلَبَسَ عَلَيْهِ حَتَّى لاَ يَدْرِي كَمْ صَلَّى فَإِذَا وَجَدَ ذَلِكَ أَحَدُكُمْ فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ