X,Y,Z = map(int, input().split()) print(Z - (X <= Z) - (Y <= Z))