def input_scan(): temp = input() x, y, z = temp.split() return (int(x), int(y), int(z)) x, y, z = input_scan() count = 0 if x <= z: count += 1 if y <= z: count += 1 print(z - count)