Sang-geun and his friends are at a ski resort. During the day they ski, and in the evening they gather at a nearby bar to spend time together.
The resort's lift is very small: it can carry only one person every 5 seconds. Because of this, everyone stands in a single line and waits their turn to board.
The friends in one group want to travel together, but even when they leave the summit at the same time they reach the lift line at different moments. So before boarding, whoever arrives first must wait for the friends coming behind, and after getting off the lift they must also wait for the friends who have not arrived yet. In effect, a group can only regroup and move on once the LAST member of that group has boarded the lift.
If a person's own group-mate has not yet reached the lift line, that person may give up their spot to the person standing directly behind them. Giving up the spot saves the yielder no time at all; only the place where they wait changes. However, the group of the person who moves forward can save time, because a friend who has already ridden up and is waiting gets to regroup sooner.
Assume everyone follows the rule: "yield your spot whenever it costs you nothing yet lets another group save time." Repeat this until no more yielding is possible, and compute the total amount of time (in seconds) that all groups together can save.
The first line contains the number of test cases, at most 100.
For each test case, the first line contains n (1 ≤ n ≤ 25,000), the number of people waiting for the lift. The second line contains a string of length n consisting only of uppercase letters, lowercase letters, and digits. Each character denotes the group of the person standing at that position; people marked with the same character belong to the same group. Uppercase and lowercase letters are treated as different groups.
For each test case, print on its own line the total time, in seconds, that all groups can save.