Problem list
Log in
#r03541 · CCC 2018 Junior

Occupy parking

Bronze III 2.0 s 256 MB

You supervise a small parking lot which has $N$ parking spaces.

Yesterday, you recorded which parking spaces were occupied by cars and which were empty.

Today, you recorded the same information.

How many of the parking spaces were occupied both yesterday and today?

Input

The first line of input contains the integer $N$ $(1 \leq N \leq 100)$. The second and third lines of input contain $N$ characters each. The second line of input records the information about yesterday’s parking spaces, and the third line of input records the information about today’s parking spaces. Each of these $2N$ characters will either be C to indicate an occupied space or . to indicate it was an empty parking space.

Output

Output the number of parking spaces which were occupied yesterday and today.

Constraints

$(1 \leq N \leq 100)$

Example 1

Input
5
CC..C
.CC..
Output
1

Only the second parking space from the left was occupied yesterday and today.

Example 2

Input
7
CCCCCCC
C.C.C.C
Output
4

The first, third, fifth, and seventh parking spaces were occupied yesterday and today.

Source
CCC 2018 Junior
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code