a=[int(i) for i in input().split()] b,c,d=a[0],a[1],a[2] if d>c and d>b: print(d-2) elif d>c or d>b: print(d-1) else: print(d)