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