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.
import sys

n=int(input())
s=str(input())
list=[]
for i in range(1,n):
	a=s[0:i]
	b=s[i:]
	print(a)
	print(b)
	count=0
	for j in range(97,97+26):
		if (chr(j) in a)and(chr(j) in b):
			count+=1
	list.append(count)
print(max(list))
import sys

n=int(input())
s=str(input())
list=[]
for i in range(1,n):
	a=s[0:i]
	b=s[i:]
	count=0
	for j in range(97,97+26):
		if (chr(j) in a)and(chr(j) in b):
			count+=1
	list.append(count)
print(max(list))