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