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