Deut 25:2-3

2If the one in the wrong deserves to be flogged, the judge shall make that person lie down and be beaten in his presence with the number of lashes proportionate to the offense.3Forty lashes may be given but not more; if more lashes than these are given, your neighbor will be degraded in your sight.