X, Y, Z = map(int, input().split()) L = set(range(1, Z+1)) print(len(L - {X, Y}))