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