Codeforces
CF Step
Youtube Linkedin Discord Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Statement : Passing the Ball

A. Passing the Ball

During a physical education class, $n$ students are lined up, numbered from $1$ to $n$ from left to right.

For each student, it is known that if they receive the ball, they will pass it either to the neighbor on their left or to the neighbor on their right. This is specified by a string $s$ of $n$ characters. Each character is either L or R: $s_i$ is L if the $i$-th student passes the ball to student $(i-1)$, and R if they pass to student $(i+1)$. The first student always passes to the second, and the last to the second-to-last (so $s$ starts with R and ends with L).

Consider the following process:

  • First, the first student receives the ball.
  • Then, exactly $n$ times, the student who has the ball passes it to their neighbor according to the rules above.

Your task is to determine how many students will receive the ball at least once during this process.


Input

The first line contains a single integer $t$ ($1 \le t \le 10000$) — the number of test cases.

Each test case consists of two lines:

  • The first line contains a single integer $n$ ($2 \le n \le 50$) — the number of students.
  • The second line contains $s$ — a string of $n$ characters L and R. The first character is R, the last is L.

Output

For each test case, print one integer — the number of students who receive the ball at least once.


Example

Input

3
4
RLRL
6
RRRRRL
9
RRLRRRRRL

Output

2
6
3

Note

In the first example, student 1 passes to student 2, who passes back to 1, and so on. Only students 1 and 2 receive the ball.

In the second example, the ball goes 1 → 2 → 3 → 4 → 5 → 6 → 5. Every student receives it at least once.