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