X, Y, Z = map(int, input().split()) count = 0 for d in range(1, Z + 1): if d not in [X, Y]: count += 1 print(count)