The package for this problem was not updated by the problem writer or Codeforces administration after we've upgraded the judging servers. To adjust the time limit constraint, a solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then the value 800 ms will be displayed and used to determine the verdict.

The following languages are only available languages for the problems from the contest

Friday the 13th, Programmers Day:

- Ada GNAT 4

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
C. Counting Fridays

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputJudging from the previous problem, Friday the 13th really doesn't treat you well, so you start thinking about how to minimize its impact on your life. You are a passionate participant of programming contests, so various competitions are an important part of your schedule. Naturally, you'd like as few of them to be spoiled as possible.

A friendly admin leaked to you the list of dates on which the contests will be held for several years ahead. Check how many of them happen to take place on Friday the 13th of any month.

Input

The first line of the input contains an integer *n* (1 ≤ *n* ≤ 10) — the number of the contests you have been told about. The following *n* lines contain dates of these contests, one per line, formatted as "YYYY-MM-DD" (1974 ≤ YYYY ≤ 2030; 01 ≤ MM ≤ 12; 01 ≤ DD ≤ 31). It's guarateed that all the given dates are correct. Two distinct contests may be at the same day.

Output

Output a single integer — the number of dates which happen to be Friday the 13th.

Examples

Input

5

2012-01-13

2012-09-13

2012-11-20

2013-09-13

2013-09-20

Output

2

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/27/2023 22:06:47 (k3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|