my ($x, $y, $z) = get.chomp.split(" "); my $ans = $z; if $x <= $z { $ans--; } if $y <= $z { $ans--; } "%d".printf($ans)