X,Y,Z=map(int,input().split()) res=0 for i in range(1,Z): if (i!=X or i!=Y): res+=1 print(res)