x, y, z = map(int, input().split()) if x == 0 and y == 0: print(z) elif x <= z and y <= z: print(z - 2) elif x <= z or y <= z: print(z - 1)