aboutsummaryrefslogtreecommitdiff
path: root/icpcBallons/main.cpp
blob: 082df7ccb797e5954e7dccdf239342bb90a70c05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<bits/stdc++.h>

using namespace std;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tt;
	cin >> tt;
	while(tt--){
    int n;
    cin >> n;
    string s;
    cin >> s;
    map<char, int> mp;
    for(auto ch : s) {
      mp[ch]++;
    }
    int ans = 0;
    for(auto p : mp) {
      if(p.second >= 2) {
        ans += p.second - 1;
      }
    }
    ans += mp.size() * 2;
    cout << ans << endl;
	}
}