x, y, z = map(int, input().split()) ans = z if x <= z: ans -= 1 if y <= z: ans -= 1 print(ans)