[Machine] The Messenger of Allah ﷺ said: "If anyone of you has doubt in their prayer and does not know whether they prayed three or four [rak'ahs], they should disregard their doubt and proceed according to what they are certain about. Then they should perform two prostrations before concluding their Salah. Because if they prayed five [rak'ahs], it will make up for their prayer as a whole." Musa said once, "If they prayed five [rak'ahs], they would make up for their prayer. And if they completed four [rak'ahs], they would prevent Satan from harm."
قَالَ رَسُولُ اللهِ ﷺ إِذَا شَكَّ أَحَدُكُمْ فِي صَلَاتِهِ فَلَمْ يَدْرِ كَمْ صَلَّى ثَلَاثًا أَمْ أَرْبَعًا فَلْيَطْرَحِ الشَّكَّ وَلْيَبْنِ عَلَى مَا اسْتَيْقَنَ ثُمَّ يَسْجُدْ سَجْدَتَيْنِ قَبْلَ أَنْ يُسَلِّمَفَإِنْ كَانَ صَلَّى خَمْسًا كَانَتْ شَفْعًا لِصَلَاتِهِ قَالَ مُوسَى مَرَّةً فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعْنَ لَهُ صَلَاتَهُ وَإِنْ كَانَ صَلَّى إِتْمَامَ أَرْبَعٍ كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ