Rock-paper-scissors is played by two people. Each player shows one of scissors (S), paper (P), or rock (R). If both players show the same shape, the round is a draw. Scissors beats paper, paper beats rock, and rock beats scissors.
One player trains for a tournament by playing against N friends at the same time for R rounds. In every round, the player and each friend choose one of the three shapes.
The score for a round is computed independently against each friend. The player receives 2 points for a win, 1 point for a draw, and 0 points for a loss.
Given the shapes chosen by the player and all friends, compute the player's final score. Then compute the maximum score the player could have earned if, before each round, the player had known all friends' choices for that round and could choose the best shape.
The first line contains the number of rounds R (1 <= R <= 50).
The second line contains a string of length R, the shapes chosen by the player in order. S means scissors, P means paper, and R means rock.
The third line contains the number of friends N (1 <= N <= 50).
Each of the next N lines contains a string of length R, the shapes chosen by one friend in order.
Print the player's actual score on the first line.
Print the maximum score the player could have earned on the second line.