#P1760B. Atilla's Favorite Problem

    ID: 574 Type: RemoteJudge 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 3 Uploaded By: Tags>greedyimplementationstrings*800

Atilla's Favorite Problem

Description

In order to write a string, Atilla needs to first learn all letters that are contained in the string.

Atilla needs to write a message which can be represented as a string ss. He asks you what is the minimum alphabet size required so that one can write this message.

The alphabet of size xx (1x261 \leq x \leq 26) contains only the first xx Latin letters. For example an alphabet of size 44 contains only the characters a\texttt{a}, b\texttt{b}, c\texttt{c} and d\texttt{d}.

The first line contains a single integer tt (1t10001 \leq t \leq 1000) — the number of test cases.

The first line of each test case contains a single integer nn (1n1001 \leq n \leq 100) — the length of the string.

The second line of each test case contains a string ss of length nn, consisting of lowercase Latin letters.

For each test case, output a single integer — the minimum alphabet size required to so that Atilla can write his message ss.

Input

The first line contains a single integer tt (1t10001 \leq t \leq 1000) — the number of test cases.

The first line of each test case contains a single integer nn (1n1001 \leq n \leq 100) — the length of the string.

The second line of each test case contains a string ss of length nn, consisting of lowercase Latin letters.

Output

For each test case, output a single integer — the minimum alphabet size required to so that Atilla can write his message ss.

Sample Input 1

5
1
a
4
down
10
codeforces
3
bcf
5
zzzzz

Sample Output 1

1
23
19
6
26

Note

For the first test case, Atilla needs to know only the character a\texttt{a}, so the alphabet of size 11 which only contains a\texttt{a} is enough.

For the second test case, Atilla needs to know the characters d\texttt{d}, o\texttt{o}, w\texttt{w}, n\texttt{n}. The smallest alphabet size that contains all of them is 2323 (such alphabet can be represented as the string abcdefghijklmnopqrstuvw\texttt{abcdefghijklmnopqrstuvw}).