x, y, z = [int(i) for i in input().split()] a = z if x <= z: a-=1 if y <= z: a-=1 print(a)