You are given a string $$$s$$$ of length $$$n$$$ consisting of the characters 0 and/or 1. You need to perform exactly one operation consisting of two steps:
A block is called maximal if it cannot be extended to the left or to the right by adding the same character. For example, after the second step, the string 100111011 will become 10101.
Count the number of different strings that can be obtained after performing this operation.
The first line contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
Each test case consists of one line containing a string $$$s$$$ ($$$3 \le |s| \le 3 \cdot 10^5$$$) consisting only of the characters 0 and 1.
Additional constraints on the input:
For each test case, print one integer — the number of different strings that can be obtained after performing the operation.
7001000010000101001110110010110101111
1223322
In the first test case, you may choose not to change any character or replace the second character. Before compression, the resulting strings are 001 and 011, respectively. After compression, both strings become 01, so the answer is $$$1$$$.
In the fifth test case:
In total, three different strings can be obtained: 101, 10101, and 1010101.