a,b,c=map(int,input().split()) if (b-a+1) >= c: print(c) else: print(b-a+1)