a,b,c=map(int,input().split()) if c-a>=0 and c-b>=0: d=2 elif c-a<0 and c-b<0: d=0 else: d=1 print(c-d)