Problem2369--CF1703B - ICPC Balloons

2369: CF1703B - ICPC Balloons

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

在ICPC竞赛中,气球分发如下:

每当一个团队解决问题时,该团队就会得到一个气球。

第一个解决问题的团队得到了一个额外的气球。

一场比赛共有26道题,分别标记为A、B、C、…、Z。你将获得比赛中已解决问题的顺序,用字符串s表示,其中第i个字符表示问题si已由某个团队解决。没有一个团队会两次解决同一问题。

确定团队收到的气球总数。请注意,有些问题可能没有一个团队能够解决。


In an ICPC contest, balloons are distributed as follows:

  • Whenever a team solves a problem, that team gets a balloon.
  • The first team to solve a problem gets an additional balloon.
A contest has 26 problems, labelled AABBCC, ..., ZZ. You are given the order of solved problems in the contest, denoted as a string ss, where the ii-th character indicates that the problem sisi has been solved by some team. No team will solve the same problem twice.

Determine the total number of balloons that the teams recieved. Note that some problems may be solved by none of the teams.

Input

The first line of the input contains an integer tt (1≤t≤1001≤t≤100) — the number of testcases.

The first line of each test case contains an integer nn (1≤n≤501≤n≤50) — the length of the string.

The second line of each test case contains a string ss of length nn consisting of uppercase English letters, denoting the order of solved problems.

Output

For each test case, output a single integer — the total number of balloons that the teams received.

Sample Input Copy

6
3
ABA
1
A
3
ORZ
5
BAAAA
4
BKPT
10
CODEFORCES

Sample Output Copy

5
2
6
7
8
17

HINT

Note

In the first test case, 55 balloons are given out:

  • Problem AA is solved. That team receives 22 balloons: one because they solved the problem, an an additional one because they are the first team to solve problem AA.
  • Problem BB is solved. That team receives 22 balloons: one because they solved the problem, an an additional one because they are the first team to solve problem BB.
  • Problem AA is solved. That team receives only 11 balloon, because they solved the problem. Note that they don't get an additional balloon because they are not the first team to solve problem AA.
The total number of balloons given out is 2+2+1=52+2+1=5.

In the second test case, there is only one problem solved. The team who solved it receives 22 balloons: one because they solved the problem, an an additional one because they are the first team to solve problem AA.

Source/Category