a = list(map(int, input().split())) b = a[2] if a[0] <= b: b -= 1 if a[1] <= b: b -= 1 print(b)