Yahya related to me from Malik from Ibn Shihab from Abu Salama ibn Abdar-Rahman ibn Awf from Abu Hurayra that the Messenger of Allah ﷺ said, "When you stand in prayer, Shaytan comes to you and confuses you until you do not know how much you have prayed. If you find that happening do two sajdas from the sitting position."
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِنَّ أَحَدَكُمْ إِذَا قَامَ يُصَلِّي جَاءَهُ الشَّيْطَانُ فَلَبَسَ عَلَيْهِ حَتَّى لاَ يَدْرِي كَمْ صَلَّى فَإِذَا وَجَدَ ذَلِكَ أَحَدُكُمْ فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ