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

if Z >= Y:
    print(Z - 2)
elif Z >= X:
    print(Z - 1)
else:
    print(Z)