An input string
of length is transferred through the network using a special protocol. The protocol can send the string through a series of operations. In one operation, we can choose a lowercase english alphabet and do one of the following:
- Transfer copy of through the network.
- Transfer copies of through the network.
Each of the above transfers take unit of time.
Find the minimum time in which we can transfer the entire string through the network.
Input Format
- The first line will contain - the number of test cases. Then the test cases follow.
- First line of each test case contains - the length of the string .
- Second line of each test case contains the string .
Output Format
For each test case, output in a single line, the minimum time required to transfer the string.
Constraints
- Sum of over all test cases does not exceed .
- String contains lowercase english alphabets only.
Sample Input 1
2
5
cbcdc
6
aabeee
Sample Output 1
5
4
Explanation
Test Case : String can be transferred through following operations: send copy of character , send copy of character , send copy of character , send copy of character , and send copy of character . Thus, total operations are required.
Test Case : String can be transferred through following operations: send copies of character , send copy of character , send copy of character , and send copies of character . Thus, total operations are required.
ConversionConversion EmoticonEmoticon