[Machine] The Messenger of Allah ﷺ said: "If one of you has doubts about his prayer and does not know how many units he has prayed, then he should rely on certainty until he is certain that he has completed it. Then, he should prostrate for two extra prostrations before saying the tasleem (greeting). For if his prayer was odd (witr), it will become even (shaf') by doing so, and if it was already even, then that would be a rebuke to the devil."
أَنَّ رَسُولَ اللهِ ﷺ قَالَ إِذَا شَكَّ أَحَدُكُمْ فِي صَلَاتِهِ فَلَمْ يَدْرِ كَمْ صَلَّى فَلْيَبْنِ عَلَى الْيَقِينِ حَتَّى إِذَا اسْتَيْقَنَ أَنْ قَدْ أَتَمَّ فَلْيَسْجُدْ سَجْدَتَيْنِ قَبْلَ أَنْ يُسَلِّمَ فَإِنَّهُ إِنْكَانَتْ صَلَاتُهُ وِتْرًا صَارَتْ شَفْعًا وَإِنْ كَانَتْ شَفْعًا كَانَ ذَلِكَ تَرْغِيمًا لِلشَّيْطَانِ