eolymp
bolt
Try our new interface for solving problems
Problems

The programming competition

The programming competition

Time limit 2 seconds
Memory limit 64 MiB

Vova conducts programming competitions and trainings in his school. To do this, he downloaded from Internet a lot of archives with programming competitions and trainings. He unpacked everything he downloaded to the hard drive of his computer, and now can not make out with the resulting set of files. Vova wants to understand how many descriptions of programming competitions he downloaded.

The pair of files is called test, if they are situated in one directory and their full names have the form "XY" or "XY.a", where "XY" is the test case number (supplemented with a leading zero if it is less than ten). The first of these files contains the input data, the second contains the answer.

The directory is called a directory with tests, if it contains tests with all numbers from 1 to N, where 1N99, and no other files (but there can be sub-directories).

The directory is called a problem, if it contains the file with name "check" and any (possibly empty) extension and a sub-directory "tests", which is a directory with tests. The directory with a problem can additionally contain other files and sub-directories.

The directory is called the contest description, if it contains at least one sub-directory, and all its sub-directories are problems.

You are given the description of all files stored on a hard drive in Vova's computer. Find out, how many contest descriptions are kept on a hard drive.

Input data

The first line contains the number of files n (1n1000). Each of the next n lines contains the full path to the file. Each line contains from 1 to 200 characters.

The path elements are separated with characters "\". At the beginning of the path there is a letter of the drive (from "A" to "Z"), then colon and "\". The directory names in the path and the file names consist of characters with codes from 33 to 126, except for the character "\". The last element of the path is a full file name. The full file name contains no more than one point. There is at least one character before and after the point. If the file name contains the point, the part of its name after the point is called extension, and the part before the point is called the file name. Otherwise, it is considered that a file has an empty extension, and the file name coincides with its full name.

The lowercase and uppercase letters in path do not differ. No directory contains the file and sub-directory with the same name.

Output data

Print the number of contest descriptions in the given set of files.

Sample of input and output data

Examples

Input example #1
22
C:\olymp\roi2005\aplusb\tests\01
C:\olymp\roi2005\aplusb\tests\01.a
C:\olymp\roi2005\aplusb\tests\02
C:\olymp\roi2005\aplusb\tests\02.a
C:\olymp\roi2005\aplusb\check.exe
C:\olymp\roi2005\gcd\tests\01
C:\olymp\roi2005\gcd\tests\01.a
C:\olymp\roi2005\gcd\tests\02
C:\olymp\roi2005\gcd\tests\02.a
C:\olymp\roi2005\gcd\check.cpp
C:\olymp\roi2005\gcd\solution.exe
C:\olymp\roi2006\aplusb\tests\01
C:\olymp\roi2006\aplusb\tests\01.a
C:\olymp\roi2006\aplusb\tests\03
C:\olymp\roi2006\aplusb\tests\03.a
C:\olymp\roi2006\aplusb\check.exe
C:\olymp\roi2006\gcd\tests\01
C:\olymp\roi2006\gcd\tests\01.a
C:\olymp\roi2006\gcd\tests\03
C:\olymp\roi2006\gcd\tests\02.a
C:\olymp\roi2006\gcd\check.cpp
C:\olymp\roi2006\gcd\solution.exe
Output example #1
1
Author Владимир Ульянцев, Федор Царев