You are given a string S of length N consisting of lowercase English letters. We will cut this string at one position into two strings X and Y. Here, we would like to maximize the number of different letters contained in both X and Y. Find the largest possible number of different letters contained in both X and Y when we cut the string at the optimal position.
def charToInt(c):
    return ord(c) - ord("a")

def stringToFlags(s):
    t = [False for i in range(26)]
    for i in range(len(s)):
        t[charToInt(s[i])] = True
    return t

def B(n, s):
    max = 0
    for i in range(1, n):
        print(s[0:i], s[i:n])
        xflags = stringToFlags(s[0:i])
        yflags = stringToFlags(s[i:n])
        
        count = 0
        for i in range(26):
            if xflags[i] and yflags[i]:
                count += 1
                if count > max:
                    max = count
    return max

def em_input(s):
    n = int(s.split("\n")[0])
    s = s.split("\n")[1]
    return B(n, s)

print(input())
def charToInt(c):
    return ord(c) - ord("a")
 
def stringToFlags(s):
    t = [False for i in range(26)]
    for i in range(len(s)):
        t[charToInt(s[i])] = True
    return t
 
def B(n, s):
    max = 0
    for i in range(1, n):
        xflags = stringToFlags(s[0:i])
        yflags = stringToFlags(s[i:n])
        
        count = 0
        for i in range(26):
            if xflags[i] and yflags[i]:
                count += 1
                if count > max:
                    max = count
    return max
 
n = int(input())
s = input()
print(B(n, s))