X, Y, Z = map(int,input().split()) if X <= Z and Y <= Z: print(Z-2) elif X > Z and Y > Z: print(Z) else: print(Z-1)