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