# [Solution] ICPC Balloons solution codeforces

ICPC Balloons solution codeforces – 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.

## [Solution] ICPC Balloons solution codeforces

A contest has 26 problems, labelledÂ đť– A,Â đť–ˇB,Â đť–˘C, …,Â đť–ąZ. You are given the order of solved problems in the contest, denoted as a stringÂ đť‘ s, where theÂ đť‘–i-th character indicates that the problemÂ đť‘ đť‘–siÂ 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Â đť‘ˇtÂ (1â‰¤đť‘ˇâ‰¤1001â‰¤tâ‰¤100)Â â€” the number of testcases.

The first line of each test case contains an integerÂ đť‘›nÂ (1â‰¤đť‘›â‰¤501â‰¤nâ‰¤50)Â â€” the length of the string.

The second line of each test case contains a stringÂ đť‘ sÂ of lengthÂ đť‘›nÂ consisting of uppercase English letters, denoting the order of solved problems.

## [Solution] ICPC Balloons solution codeforces

For each test case, output a single integerÂ â€” the total number of balloons that the teams received.

Example
input

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

output

Copy
5
2
6
7
8
17


## [Solution] ICPC Balloons solution codeforces

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

• ProblemÂ đť– AÂ 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Â đť– A.
• ProblemÂ đť–ˇBÂ 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Â đť–ˇB.
• ProblemÂ đť– AÂ 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Â đť– A.

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Â đť– A.