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