X,Y,Z = map(int,input().split(" ")) count = 0 for i in range(Z): if i == X or i==Y: pass else: count += 1 print(count)