#B4114. Rock-Paper-Scissors Game Outcome
Rock-Paper-Scissors Game Outcome
Rock-Paper-Scissors Game Outcome
You are given two strings of length \(N\): \(S\) and \(T\). The string \(S\) contains only the characters R
and S
, and the string \(T\) contains only the characters R
and P
. Here, the characters represent the following gestures in the game of Rock-Paper-Scissors:
R
represents RockS
represents ScissorsP
represents Paper
Aoi and Bitaro play \(N\) rounds of Rock-Paper-Scissors. In the \(i\)-th round \((1 \leq i \leq N)\), Aoi's gesture is given by \(S_i\) and Bitaro's gesture is given by \(T_i\). Determine the number of rounds in which Aoi wins and the number of rounds in which Bitaro wins.
The rules of Rock-Paper-Scissors are as follows:
- Rock beats Scissors, i.e. \(R \to S\)
- Scissors beats Paper, i.e. \(S \to P\)
- Paper beats Rock, i.e. \(P \to R\)
If both players choose the same gesture, the round is a tie and neither wins.
inputFormat
The input consists of three lines:
- An integer \(N\) representing the number of rounds.
- A string \(S\) of length \(N\) which contains only the characters
R
andS
. - A string \(T\) of length \(N\) which contains only the characters
R
andP
.
outputFormat
Output two integers separated by a space: the number of rounds Aoi wins and the number of rounds Bitaro wins.
sample
3
RSR
RRP
0 2