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