[Machine] The Messenger of Allah ﷺ said, "If one of you is unsure whether he has prayed three or four (rak'ahs), then he should complete it and perform one more rak'ah, then make two prostrations of forgetfulness while sitting. If his prayer was five (rak'ahs), then the extra rak'ah is a voluntary prayer, and if it was four (rak'ahs), then they are a means of thwarting Satan, and this is their meaning."
قَالَ رَسُولُ اللهِ ﷺ إِذَا لَمْ يَدْرِ أَحَدُكُمْ ثَلَاثًا صَلَّى أَمْ أَرْبَعًا؟ فَلْيُتِمَّ وَيُصَلِّي رَكْعَةً ثُمَّ يَسْجُدْ بَعْدَ ذَلِكَ سَجْدَتَيِ السَّهْوِ وَهُوَ جَالِسٌ فَإِنْ كَانَتْ صَلَاتُهُ خَمْسًا شَفَعَتْ صَلَاتَهُ وَإِنْ كَانَتْ أَرْبَعًا كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ وَبِمَعْنَاهُ