def is_leap(n): if n % 4 == 0 and n % 100 != 0 and n % 400 == 0: return True else: return False # 2014/7/23(Wed) N = int(input()) weds = 0 days = 0 for i in range(2014, N+1): if is_leap(i): days += 366 else: days += 365 if days % 7 == 0: weds += 1 print(weds)