#C9202. Count Books

    ID: 53270 Type: Default 1000ms 256MiB

Count Books

Count Books

You are given a list of book categories. Each category is either fiction or non-fiction. Your task is to count the number of fiction and non-fiction books in the list.

Let \( F \) represent the number of fiction books and \( NF \) represent the number of non-fiction books. You need to compute and output these two values.

inputFormat

The input is given via stdin and consists of two lines:

  • The first line contains an integer \( n \) representing the number of books.
  • The second line contains \( n \) space-separated strings, each being either fiction or non-fiction.

outputFormat

Output to stdout a single line containing two space-separated integers. The first integer is the number of fiction books, and the second integer is the number of non-fiction books.

## sample
5
fiction non-fiction fiction fiction non-fiction
3 2