X,Y,Z=map(int,input().split()) cnt=0 l=list(range(1,Z+1)) if X in l: cnt+=1 if Y in l: cnt+=1 print(Z-cnt)