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