In an unspecified zoo, there are walruses (in romanian "morse") sitting neatly in a line.
The walruses are denoted by a string of characters , where:
-
.
, if the -th walrus is sleeping; or -
-
, if the -th walrus is awake.
Each second, the following things can happen:
- You can choose to wake up any walrus yourself; and
- Every walrus which was awakened in the previous second will wake up its neighbours. As an exception, the walruses which were awake at the start will never wake up their neighbours.
Task
Since waking up the walruses yourself is dangerous, you ask yourself the following questions:
- What is the smallest number of walruses you need to wake up yourself in order to guarantee that all walruses will eventually be awake?
- While waking up as few walruses yourself as possible, what is the earliest possible time (in seconds) when all of the walruses will be awake?
Input data
Each test contains multiple test cases. The first line of input contains a single integer — the number of test cases.
The first line of each test case contains a single integer — the number of walruses.
The second line of each test case contains a string of characters , where:
-
.
, if the i-th walrus is initially asleep; or -
-
, otherwise.
Output data
For each test case, print two integers:
- The smallest number of walruses you need to wake up yourself in order to guarantee that all walruses will eventually be awake;
- While waking up as few walruses yourself as possible, the earliest possible time (in seconds) when all of the walruses will be awake.
Constraints and clarifications
- It is guaranteed that at least one walrus is initially asleep and that the sum of across all test cases does not exceed .
# | Points | Constraints |
---|---|---|
1 | 0 | Examples |
2 | 10 | All walruses are initially asleep. |
3 | 20 | |
4 | 35 | , |
5 | 35 | No additional constraints |
Example
stdin
3
5
..-..
3
...
20
...---....---.--...-
stdout
2 3
1 2
4 4
Explanation
An optimal strategy for the first test case:
In the first second, you can wake up the second walrus yourself:
..-..
.--..
In the second second, you can wake up the fifth walrus yourself. Additionally, the second walrus will wake up the first walrus:
.--..
.--.-
---.-
In the third second, you will not wake up any walruses yourself. However, the fourth walrus will be awakened by the fifth walrus:
---.-
-----
In total, you will have awakened walruses yourself, which is the minimum required to wake up every walrus.
While waking up walruses yourself, the minimum total time needed so that every walrus wakes up is seconds.
An optimal strategy for the second test case:
In the first second, you will wake up the second walrus yourself. The other walruses will be woken up in the next second:
...
.-.
---