x = 0 y = 0 z = 0 tmp = input() x = int(tmp.split(" ")[0]) y = int(tmp.split(" ")[1]) z = int(tmp.split(" ")[2]) n = z if x >= z: n -= 1 if y >= x: n -= 1 print(n)