X, Y, Z = map(int, input().split()) print(len([a for a in range(1, Z + 1) if not a in [X, Y]]))