import sys readline=sys.stdin.readline X,Y,Z=map(int,readline().split()) ans=Z ans-=X<=Z ans-=Y<=Z print(ans)