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