### COCI 2008/2009, Croatian Regional

Rock-paper-scissors is a popular two-player game. In the game, each of the players uses their hand to show one of three symbols: rock, paper or scissors. If both players show the same symbol, the game is a tie. Otherwise, scissors beat paper, paper beats rock and rock beats scissors.

Sven has been studying the psychological intricacies of the game for years and has become a real master at the game, his friends not standing a chance against him in one-on-one games. With the world championships around the corner, Sven is practicing his skills playing simultaneous games with N of his friends. One such game consists of R rounds. In each round, Sven and each of his friends show one of the three symbols.

When calculating the score, in each round, Sven's symbol is independently compared to each of his friends' symbols. Sven scores two points for every win and one point for every tie. Sven does not get points for losing.

Write a program that calculates Sven's total score, and also his largest possible score had he known in advance all the symbols his friends would show.

### Input

The first line contains the integer R (1 ≤ R ≤ 50), the number of rounds played.
The second line contains a string of R letters 'S', 'P' or 'R'. The string represents symbols that Sven showed in each round. 'S' is for scissors, 'P' for paper, 'R' for rock.
The third line contains the integer N (1 ≤ N ≤ 50), the number of friends.
Each of the following N lines contains a string of R letters 'S', 'P' or 'R'. These are the symbols shown by each of the N friends in each of the R rounds.

### Output

Output Sven's actual score on the first line.
Output his largest possible score on the second line, assuming his friends didn't change their symbols.

### Sample Input

`5SSPPR1SSPPR`

`510`

### Sample Input

`5SSPPR2PPRRSRRSSP`

`1015`

### Sample Input

`4SPRS4RPRPSRRRSSPRPSPS`

### Sample Output

`1221`

Point Value: 5
Time Limit: 1.00s
Memory Limit: 32M

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

• (0/0)
how in the world am i supposed to find the maximum points?

• (0/0)
That's the whole point (haha, get it?) of the problem! Spend some time thinking about it, and if you still can't figure it out, come back to this problem later (in a day, a week, a month... however long it takes). That'll help you improve infinitely more than somebody just telling you how to do it.

• (0/0)
also, i get your pun, haha very funny

• (0/0)
what a great teacher you are jargon, i appreciate all your teachings