d = 0 cnt = 0 for y in range(2014, 10**10+1): if (y%4==0 and y%100!=0) or y%400==0: d += 2 else: d += 1 if d%7 == 0: d = 0 cnt += 1 print(cnt)