(off1, off2, end) = map(int, input().rstrip().split(' ')) count = 0 for day in range(1, end+1): if off1 != day and off2 != day: count += 1 print('{}'.format(count))