x,y,z = map(int,input()) answer = z if x <= z: answer -= 1 if y <= z: answer -= 1 print(answer)