#K83587. Fixing Broken Lights

    ID: 36230 Type: Default 1000ms 256MiB

Fixing Broken Lights

Fixing Broken Lights

You are given several test cases, each containing a string that represents a series of lights. In the string, the character 'o' represents a working light and 'x' represents a broken light. To repair the lights, each broken light must be fixed individually. Mathematically, if S is the light pattern, then the minimum number of operations required is given by $$\text{operations} = #{i : S_i = 'x'}$$. Your task is to determine the number of operations needed for each test case.

inputFormat

The input begins with an integer T, the number of test cases. For each test case, the first line contains an integer N representing the length of the light pattern, followed by a line containing the string of length N which consists of the characters 'o' and 'x'.

outputFormat

For each test case, output a single integer on a new line representing the minimum number of operations required to fix the broken lights (i.e. the total number of 'x' characters in the string).## sample

1
5
xxxxx
5

</p>