a=[int(i) for i in input().split()] bkame=a[2] if a[1]==a[0] and bkame>=a[0]: bkame-=1 elif bkame>=a[0]: bkame-=1 elif bkame>=a[1]: bkame-=1 print(bkame)