BlueBook - Voting

View as PDF

Submit solution

Points: 4
Time limit: 1.0s
Memory limit: 16M

Problem type
BlueBook

Given N characters C_{1},\ldots C_{N}, each denoting one vote for the corresponding candidate, determine the number of votes received by each candidate, as well as the number of spoiled ballots.

Votes for valid candidates in the election are denoted by the letters A through F, inclusive. Any other character represents a spoiled ballot.

Input Specification

The first line contains a single integer N (1 \le N \le 1\,000).
The following N lines each contain a single character C_{i}, representing one vote.

Output Specification

Lines 1…6 should each contain one integer, the number of votes that candidates AF, respectively, received in the election. Line 7 should also contain one integer, the number of spoiled ballots.

Sample Input

5
A
B
C
B
%

Sample Output

1
2
1
0
0
0
1

Comments

There are no comments at the moment.