x, y, z = list(map(int, input().split())) cnt = 0 if x <= z: cnt += 1 if y <= z: cnt += 1 print(z - cnt)