c;main(long long n){scanf("%lld",&n);while(n>2014)n>2414?n-=400,c+=57:(c+=(n+n/4-n/100+n--/400)%7==3);c=!printf("%d",c);}