#C32. Count Books by Genre

    ID: 46600 Type: Default 1000ms 256MiB

Count Books by Genre

Count Books by Genre

You are given a list of books, each with a title and a genre. Your task is to count the number of books that belong to a specified genre.

The input begins with an integer (N) representing the number of books. This is followed by (N) lines, each containing two space-separated strings: the title and the genre of a book. The last line of input contains the genre you need to search for.

Note: Comparisons between genres are case sensitive. For example, "Fiction" and "fiction" are considered different.

inputFormat

The first line contains an integer (N) ((N \geq 0)), the number of books. The next (N) lines each contain two space-separated strings representing a book's title and its corresponding genre. The final line contains a single string representing the search genre.

outputFormat

Output a single integer denoting the count of books whose genre matches the given search genre exactly.## sample

5
HarryPotter Fiction
TheHobbit Fantasy
CProgramming Education
TheGreatGatsby Fiction
JavaProgramming Education
Fiction
2