def weekday(year, month, day): if month in [1, 2]: year -= 1 month += 13 else: month += 1 aa = int(year * 365.25) bb = int(month * 30.6) cc = year // 400 dd = year // 100 ee = aa + bb + cc + day - dd - 429 ff = ee // 7 * 7 return ee - ff def main(): n = int(input()) ans = 0 for y in range(2015, n + 1): ans += weekday(y, 7, 23) == 2 print(ans) if __name__ == '__main__': main()