(off_day1, off_day2, end_day) = map(int, input().rstrip().split(' ')) count = end_day if off_day1 <= end_day: count -= 1 if off_day2 <= end_day: count -= 1 print('{}'.format(count))