import datetime import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): #2014年7月23日(水) n=int(input()) ans=0 for y in range(2015,n+1): d=datetime.date(2000+y%400,7,23) ans+=d.weekday()==2 print(ans) main()