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