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