#!/usr/bin/python from datetime import datetime n = int(raw_input()) yy = 2014 md = 7, 23 x = datetime(yy, *md).weekday() N = 400 arr = [datetime(y, *md).weekday() for y in xrange(yy+1, yy+1+N)] p, q = divmod(n-yy, N) res = arr.count(x) * p + arr[:q].count(x) print res