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