If you are in doubt, the doubt is on the fourth rakah because you are certain that you have prayed three but doubting the fourth one. In this case, pray the fourth as it is the doubtful one.
If you are in doubt, the doubt is on the fourth rakah because you are certain that you have prayed three but doubting the fourth one. In this case, pray the fourth as it is the doubtful one.