N,A,B=map(int,open(0).read().split());S,T=divmod(A+B,N);print(max(max(A,B)-S-(0