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