Parking#504

Parking

1 second
128 megabytes
Very easy

You want to park the cars of guests on the street. According to the rules, it is forbidden to park cars:

You have created plans for nearby streets by dividing them into segments of meters each (this is the minimum length required to park a car). In the plan: a segment with an exit is denoted by , a bus stop by , a crossing by , and all other segments by . Write a program that determines the number of valid parking spaces for each street.

Input

The first line contains the number of streets (1 \leq n \leq 100). Each of the following lines contains a street plan as a string of length from to consisting only of the characters , , , and .

Output

For each street plan, output a single line containing the number of valid parking spaces.

Examples

Example 1

Loading
Loading