from collections import OrderedDict 



# Function to remove all duplicates from string 

# and order does not matter 

def removeDupWithoutOrder(str): 

   

    # set() --> A Set is an unordered collection  

    #            data type that is iterable, mutable,  

    #            and has no duplicate elements. 

    # "".join() --> It joins two adjacent elements in 

    #               iterable with any symbol defined in  

    #               "" ( double quotes ) and returns a  

    #               single string 

    return "".join(set(str)) 

  

# Function to remove all duplicates from string  

# and keep the order of characters same 

def removeDupWithOrder(str): 

    s = "".join(OrderedDict.fromkeys(str)) 

    return "".join(sorted(s))



n = int(eval(input()))

s = eval(input())

maxcnt = 0

oset = set()

for i in range(1,n):

    s1 = removeDupWithOrder(s[0:i])

    s2 = removeDupWithOrder(s[i:n])

    oset.add(s1+' '+s2)

ls = list(oset)

for x in ls:

    s1,s2 = list(map(str,x.split()))

    cnt = 0

    for i in range(len(s1)):

        if s1[i] in s2:

            cnt += 1

    if maxcnt < cnt:

        maxcnt = cnt

print(maxcnt)
n = int(eval(input()))

s = eval(input())

answer = 0

for i in range(1,n):

    a = s[:i]

    b = s[i:]

    oset = set()

    oset = set(a) & set(b)

    answer = max(answer, len(oset))

print(answer)
from collections import OrderedDict

# Function to remove all duplicates from string
# and order does not matter
def removeDupWithoutOrder(str):
    # set() --> A Set is an unordered collection
    #            data type that is iterable, mutable,
    #            and has no duplicate elements.
    # "".join() --> It joins two adjacent elements in
    #               iterable with any symbol defined in
    #               "" ( double quotes ) and returns a
    #               single string
    return "".join(set(str))


# Function to remove all duplicates from string
# and keep the order of characters same
def removeDupWithOrder(str):
    s = "".join(OrderedDict.fromkeys(str))
    return "".join(sorted(s))


n = int(eval(input()))
s = eval(input())
maxcnt = 0
oset = set()
for i in range(1, n):
    s1 = removeDupWithOrder(s[0:i])
    s2 = removeDupWithOrder(s[i:n])
    oset.add(s1 + " " + s2)
ls = list(oset)
for x in ls:
    s1, s2 = list(map(str, x.split()))
    cnt = 0
    for i in range(len(s1)):
        if s1[i] in s2:
            cnt += 1
    if maxcnt < cnt:
        maxcnt = cnt
print(maxcnt)

n = int(eval(input()))
s = eval(input())
answer = 0
for i in range(1, n):
    a = s[:i]
    b = s[i:]
    oset = set()
    oset = set(a) & set(b)
    answer = max(answer, len(oset))
print(answer)

-from collections import OrderedDict - -# Function to remove all duplicates from string -# and order does not matter -def removeDupWithoutOrder(str): -    # set() --> A Set is an unordered collection -    #            data type that is iterable, mutable, -    #            and has no duplicate elements. -    # "".join() --> It joins two adjacent elements in -    #               iterable with any symbol defined in -    #               "" ( double quotes ) and returns a -    #               single string -    return "".join(set(str)) - - -# Function to remove all duplicates from string -# and keep the order of characters same -def removeDupWithOrder(str): -    s = "".join(OrderedDict.fromkeys(str)) -    return "".join(sorted(s)) - - -maxcnt = 0 -oset = set() +answer = 0 -    s1 = removeDupWithOrder(s[0:i]) -    s2 = removeDupWithOrder(s[i:n]) -    oset.add(s1 + " " + s2) -ls = list(oset) -for x in ls: -    s1, s2 = list(map(str, x.split())) -    cnt = 0 -    for i in range(len(s1)): -        if s1[i] in s2: -            cnt += 1 -    if maxcnt < cnt: -        maxcnt = cnt -print(maxcnt) +    a = s[:i] +    b = s[i:] +    oset = set() +    oset = set(a) & set(b) +    answer = max(answer, len(oset)) +print(answer)