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.

-----Constraints-----
 - 2 \leq N \leq 100
 - |S| = N
 - S consists of lowercase English letters.

-----Input-----
Input is given from Standard Input in the following format:
N
S

-----Output-----
Print the largest possible number of different letters contained in both X and Y.

-----Sample Input-----
6
aabbca

-----Sample Output-----
2

If we cut the string between the third and fourth letters into X = aab and Y = bca, the letters contained in both X and Y are a and b.
There will never be three or more different letters contained in both X and Y, so the answer is 2.
[{"code": "#\n# abc096 b\n#\nimport sys\nfrom io import StringIO\nimport unittest\nfrom collections import Counter\n\n\nclass TestClass(unittest.TestCase):\n    def assertIO(self, input, output):\n        stdout, stdin = sys.stdout, sys.stdin\n        sys.stdout, sys.stdin = StringIO(), StringIO(input)\n        resolve()\n        sys.stdout.seek(0)\n        out = sys.stdout.read()[:-1]\n        sys.stdout, sys.stdin = stdout, stdin\n        self.assertEqual(out, output)\n\n    def test_\u5165\u529b\u4f8b_1(self):\n        input = \"\"\"6\naabbca\"\"\"\n        output = \"\"\"2\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_2(self):\n        input = \"\"\"10\naaaaaaaaaa\"\"\"\n        output = \"\"\"1\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_3(self):\n        input = \"\"\"45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir\"\"\"\n        output = \"\"\"9\"\"\"\n        self.assertIO(input, output)\n\n\ndef resolve():\n    N = int(input())\n    S = input()\n\n    ans = 0\n    for i in range(1, N-1):\n        x = Counter(S[0:i])\n        y = S[i:]\n        tmp = 0\n        for j in list(x.keys()):\n            if j in y:\n                tmp += 1\n        ans = max(ans, tmp)\n\n    print(ans)\n\n\ndef __starting_point():\n    # unittest.main()\n    resolve()\n\n__starting_point()", "passed": true, "time": 0.17, "memory": 14400.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nans = 0\nfor i in range(1,N-1):\n  set1 = set(S[:i])\n  set2 = set(S[i:])\n  z = set1.intersection(set2)\n  ans = max(ans,len(z))\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nans = 0\nfor i in range(1, N):\n    L = set(S[:i])\n    R = set(S[i:])\n    ans = max(ans, len(L & R))\n\nprint(ans)", "passed": true, "time": 0.24, "memory": 14200.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\nans = 0\nfor i in range(1, n):\n    count = 0\n    x = sorted(set(s[:i]))\n    y = sorted(set(s[i:]))\n    for j in x:\n        if j in y:\n            count += 1\n    ans = max(ans, count)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nans = 0\nfor i in range(n-1):\n    front = set(s[:i+1])\n    back = set(s[i+1:])\n    ans = max(ans, len(front&back))\nprint(ans)", "passed": true, "time": 0.36, "memory": 14112.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\ncnt = 0\nfor i in range(N):\n    s1 = set(S[:i])\n    s2 = set(S[i:])\n    l: int = len(s1 & s2)\n    if l > cnt:\n        cnt = l\n\nprint(cnt)\n", "passed": true, "time": 0.34, "memory": 14348.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\ndef check(a,b):\n  c = [0] * 26\n  d = [0] * 26\n  for i in range(len(a)):\n    c[ord(a[i])-97] = 1\n  for i in range(len(b)):\n    d[ord(b[i])-97] = 1\n  ans = 0\n  for i in range(26):\n    if c[i] == 1 and d[i] == 1:\n      ans += 1\n  return ans\n\nres = 0\nfor i in range(n):\n  res = max(res,check(s[:i],s[i:]))\nprint(res)\n", "passed": true, "time": 0.21, "memory": 14124.0, "status": "done"}, {"code": "_ = input()\nS = input()\n\nprint(max([len(set(S[:i]) & set(S[i:])) for i in range(len(S))]))", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "n=int(input())\ns=input()\ns=list(s)\n\nx=[]\n\nfor i in range(n):\n    a=s[:i]\n    b=s[i:]\n    cnt=0\n    c=set(a)\n    d=set(b)\n    c=list(c)\n    d=list(d)\n    for j in range(len(c)):\n        for k in range(len(d)):\n            if c[j]==d[k]:\n                cnt+=1\n                break\n    x.append(cnt)\n\nprint(max(x))", "passed": true, "time": 0.23, "memory": 14140.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nprint(max(len(set(s[:i])&set(s[i:])) for i in range(n)))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nlist1 =  []\nfor i in range(N):\n  x = set()\n  \n  for s in S[:i+1]:\n    if s in S[i+1:]:\n      x.add(s)\n  list1.append(len(x))\nprint(max(list1))", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "n=int(input())\nS=input()\nans=0\nfor i in range(1,len(S)):\n  S1=S[:i]\n  S2=S[i:]\n  cnt = set()\n  for s1 in S1:\n    if s1 in S2:\n      cnt.add(s1)\n  ans = max(ans,len(cnt))\nprint(ans)", "passed": true, "time": 0.24, "memory": 13976.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nans=0\nfor i in range(1,n):\n  cnt=0\n  l=set (s[:i])\n  r=set (s[i:])\n  for v in l:\n    if v in r:\n      cnt+=1\n  ans=max(ans,cnt)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nmax_cnt = 0\nfor i in range(1, N):\n    x = set(S[0:i])\n    y = set(S[i:N])\n    x_y = len(x & y)\n    \n    if x_y > max_cnt:\n        max_cnt = x_y\n        \nprint(max_cnt)", "passed": true, "time": 0.24, "memory": 14052.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\nans = 0\nc = 0\nfh = []\nlh = s\nfor i in range(n):\n  tmp = lh.pop(0)\n  if tmp not in fh:\n    if tmp in lh:\n      c += 1\n  elif tmp not in lh:\n    c -= 1\n  fh.append(tmp)\n  ans = max(ans, c)\nprint(ans)", "passed": true, "time": 0.2, "memory": 14164.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nans=0\nfor i in range(n-1):\n    a=set()\n    b=set()\n    for j in range(i):\n        a.add(s[j])\n    for j in range(i,n):\n        b.add(s[j])\n    ans=max(ans,len(a&b))\nprint(ans)", "passed": true, "time": 0.21, "memory": 14236.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nmax_counter = 0\nfor i in range(1, N-1):\n    x = set(S[0:i])\n    y = set(S[i:N])\n    if len(x & y) > max_counter:\n        max_counter = len(x & y)\n\nprint(max_counter)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nlist = [0]*N\nfor i in range(N):\n    A = S[:i]\n    B = S[i:]\n    A = set(A)\n    B = set(B)\n    for j in A:\n      if j in B:\n        list[i] += 1\nlist = sorted(list)\nprint(list[-1])", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nc = 0\nfor i in range(1,n-1):\n  x = set(s[:i])\n  y = set(s[i:])\n  cap = x&y\n  c = max(c,len(cap))\nprint(c)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "n = int(input())\ns = input()\na = []\nfor i in range(1, len(s)):\n    s1 = list(s[:i])\n    s2 = list(s[i:])\n    b = []\n    for j in s1:\n        if j in s2 and j not in b:\n            b.append(j)\n    a.append(len(b))\nprint(max(a))", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "n=int(input())\ns=str(input())\n\nans=0\nfor i in range(1,n):\n  be_s=set(s[:i])\n  af_s=set(s[i:])\n  num=len(be_s & af_s)\n  ans=max(ans,num)\n  \nprint(ans)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\ncount = []\nfor i in range(1,n):\n    first = s[:i]\n    second= s[i:]\n    # print(first,second)\n    count.append(len(set(first)&set(second)))\n\n# print(count)\nprint((max(count)))\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nL = \"\"\nR = \"\"\nC = \"\"\ntmp = 0\nans = []\nfor i in range(1, len(s)):\n    L = s[:i]\n    R = s[i:]\n    C = len(set(L) & set(R))\n    ans.append(C)\n    L = \"\"\n    R = \"\"\nprint(max(ans))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "import sys\nlines = [s.rstrip(\"\\n\") for s in sys.stdin.readlines()]\nn, = [int(num) for num in lines.pop(0).split(\" \")]\ns = lines.pop(0)\n\nans = 0\nfor i in range(n):\n    intersection = set(s[:i]) & set(s[i:])\n    num = len(intersection)\n    if num > ans:\n        ans = num\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N = int(input())\nS = [i for i in input()]\nANS = []\n\nfor i in range(1, N+1):\n    ans = 0\n    A = []\n    B = []\n    A = list(set(S[:i]))\n    B = list(set(S[i:]))\n    for a in A:\n        for b in B:\n            if a == b:\n                ans += 1\n    ANS.append(ans)\nprint(max(ANS))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nans = 0\n\nfor i in range(n):\n    #\u8907\u6570\u306e\u30ea\u30b9\u30c8\u304b\u3089\u5171\u901a\u3059\u308b\u8981\u7d20\u3092\u62bd\u51fa\n    ans = max(ans, len(set(list(s[:i])) & set(list(s[i:]))))\n\nprint(ans)", "passed": true, "time": 0.23, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nans = 0\nfor i in range(1, n+1):\n    cnt = 0\n    x = s[0:i]\n    y = s[i:n+1]\n    for j in range(97, 123):\n        if chr(j) in x and chr(j) in y:\n            cnt += 1\n    ans = max(cnt, ans)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nc = 0\nfor i in range(n-1):\n    xy=set(s[i+1:])&set(s[:i+1])\n    c = max(c,len(xy))\nprint(c)", "passed": true, "time": 0.19, "memory": 14220.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nalphabets = [chr(i + 97) for i in range(26)]\n\n# forward\nl1 = [0] * (n-1)\nnow = [False] * 26\nfor i in range(n-1):\n    now[ord(s[i]) - 97] = True\n    l1[i] = now.copy()\n\n# backward\nl2 = [0] * (n-1)\nnow = [False] * 26\nfor i in range(n-1, 0, -1):\n    now[ord(s[i]) - 97] = True\n    l2[i-1] = now.copy()\n\nans = 0\nfor i in range(n-1):\n    cnt = 0\n    for j in range(26):\n        if l1[i][j] and l2[i][j]:\n            cnt += 1\n\n    if ans < cnt:\n        ans = cnt\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\ncnt = []\nfor n in range(1, N):\n    x = sorted(S[:n])\n    y = sorted(S[n:])\n    cnt.append(len(set(x)&set(y)))\n        \nprint(max(cnt))", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "n = int(input())\ns = input()\ncount = 0\nans = 0\nfor i in range(0, n - 1):\n    x = list(s[:i + 1])\n    y = list(s[i + 1:])\n    for c in range(ord('a'), ord('z') + 1):\n        if chr(c) in x and chr(c) in y:\n            count += 1\n    if ans < count:\n        ans = count\n    count = 0\nprint(ans)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "import collections\nn = int(input())\ns = input()\nans = 0\nfor l in range(1,n):\n  s1 = s[:l]\n  s2 = s[l:]\n  s1 = collections.Counter(s1)\n  s2 = collections.Counter(s2)\n  num = 0\n  for i in s1:\n    if i in s2:\n      num += 1\n      ans = max(ans,num)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nprint(max([len(set(list(S[:i])) & set(list(S[i:]))) for i in range(N)]))", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nans = []\nfor i in range(1,n):\n    cnt = 0\n    A = set(s[:i])\n    B = set(s[i:])\n    for j in A:\n        if j in B:\n            cnt += 1\n    ans.append(cnt)\nprint(max(ans))", "passed": true, "time": 0.35, "memory": 14212.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nmx = -1\nfor i in range(1,n):\n    x = set(s[0:i])\n    y = set(s[i:])\n    mx = max(mx,len(x&y))\nprint(mx)\n    \n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nans = 0\n\nfor i in range(1,len(s)):\n  s1 = s[:i]\n  s2 = s[i:]\n  cnt = set()\n  for j in s1:\n    if j in s2:\n      cnt.add(j)\n  ans = max(ans,len(cnt))\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nans = 0\nfor i in range(N):\n    l = S[:i]\n    r = S[i:]\n    now = len(set(l) & set(r))\n    ans = max(ans, now)\nprint(ans)", "passed": true, "time": 0.23, "memory": 14208.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\nres = []\n\nfor i in range(1, N):\n  res.append(len(set(S[:i]) & set(S[i:])))\n\nprint(max(res))", "passed": true, "time": 0.31, "memory": 14344.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nres = 0\nfor i in range(1,N):\n    com = set(S[:i]) & set(S[i:])\n    if res<len(com):\n        res=len(com)\nprint(res)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\ndef f(s, t):\n  set_s = set()\n  set_t = set()\n  for i in s:\n    set_s.add(i)\n  for i in t:\n    set_t.add(i)\n  return len( set_s & set_t )\n\nans = 0\nfor i in range(1,N):\n  s = S[i:]\n  t = S[:i]\n  ans = max(ans, f(s ,t))\nprint(ans)", "passed": true, "time": 0.16, "memory": 14220.0, "status": "done"}, {"code": "\nN = int(input())\nS = input()\n\nans = 0\nfor i in range(1,N):\n    common = set(S[i:]) & set(S[:i])\n    ans = max(ans,len(common))\n\nprint(ans)", "passed": true, "time": 0.23, "memory": 14112.0, "status": "done"}, {"code": "#!/usr/local/bin/python3\n# https://atcoder.jp/contests/abc098/tasks/abc098_b\n\nN = int(input())\nS = input()\n\n\ndef check(i):\n    return len(set(S[:i]) & set(S[i:]))\n\n\nans = [0] * N\nfor i in range(N):\n    ans[i] = check(i)\n\nprint((max(ans)))\n", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "import sys\n\ninput = sys.stdin.readline\nN = int(input())\nS = list(input().strip())\n\nans = 0\nfor i in range(N):\n    ans = max(ans, len(set(S[:i]) & set(S[i:])))\nprint(ans)", "passed": true, "time": 0.16, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nalphabets = 'abcdefghijklmnopqrstuvwxyz'\nmax_chr = 0\n\nfor i in range(len(s)-1):\n    cnt = 0\n    for letter in alphabets:\n        if (letter in s[:i+1]) and (letter in s[i+1:]):\n            cnt += 1\n    max_chr = max(max_chr, cnt)\nprint(max_chr)", "passed": true, "time": 0.33, "memory": 14348.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nans = 0\nfor i in range(1,n):\n    x,y = set(s[:i]),set(s[i:])\n    ans = max(ans,len(x&y))\nprint(ans)", "passed": true, "time": 0.34, "memory": 14200.0, "status": "done"}, {"code": "import math\nfrom math import gcd,pi,sqrt\nINF = float(\"inf\")\n\nimport sys\nsys.setrecursionlimit(10**6)\nimport itertools\nfrom collections import Counter,deque\ndef i_input(): return int(input())\ndef i_map(): return list(map(int, input().split()))\ndef i_list(): return list(i_map())\ndef i_row(N): return [i_input() for _ in range(N)]\ndef i_row_list(N): return [i_list() for _ in range(N)]\ndef s_input(): return input()\ndef s_map(): return input().split()\ndef s_list(): return list(s_map())\ndef s_row(N): return [s_input for _ in range(N)]\ndef s_row_str(N): return [s_list() for _ in range(N)]\ndef s_row_list(N): return [list(s_input()) for _ in range(N)]\n\ndef main():\n    n = i_input()\n    s = s_input()\n    ans = 0\n    for i in range(n):\n        l = set(s[:i])\n        r = set(s[i:])\n        trial = 0\n        for k in l:\n            if k in r:\n                trial += 1\n        ans = max(ans,trial)\n    print(ans)\n\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.21, "memory": 14416.0, "status": "done"}, {"code": "N=int(input())\nS=input()\nans=0\ns=\"abcdefghijklmnopqrstuvwxyz\"\nfor i in range(1,N):\n    T1=S[0:i]\n    T2=S[i:N]\n    count=0\n    for c in s:\n        if c in T1 and c in T2:\n            count+=1\n    ans=max(ans,count)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\ncnt = 0\nfor i in range(1, n-1):\n    tmp = 0\n    r, l = s[:i], s[i:]\n    rs = list(set(r))\n    for ri in rs:\n        if l.count(ri) > 0:\n            tmp += 1\n    cnt = max(cnt, tmp)\n\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nans = 0\nfor i in range(1, N - 1):\n    ans = max(ans, len(set(S[:i]) & set(S[i:])))\nprint(ans)", "passed": true, "time": 0.23, "memory": 14212.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\ndic = {}\n\nfor i in range(N):\n  if S[i] not in dic.keys():\n    dic[S[i]] = [i]\n  else:\n    dic[S[i]].append(i)\n    \nans = 0\nfor j in range(1,N):\n  cnt = 0\n  for k in dic.values():\n    check1 = False\n    check2 = False\n    for l in k:\n      if l < j:\n        check1 = True\n      if j <= l:\n        check2 = True\n    if check1 and check2:\n      cnt += 1\n  ans = max(ans, cnt)\n  \nprint(ans)", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "N=int(input())\nS=input()\nalf=\"abcdefghijklmnopqrstuvwxyz\"\nans=0\n\nfor i in range(N-1):\n    S1=list(S[0:i+1])\n    S2=list(S[i+1:N])\n\n    temp=0\n    li1=[0]*26\n    li2=[0]*26\n\n    for j in range(len(S1)):\n        li1[alf.find(S1[j])]+=1\n    for k in range(len(S2)):\n        li2[alf.find(S2[k])]+=1\n    \n    for l in range(26):\n        if min(li1[l],li2[l])!=0:\n            temp+=1\n    if temp>ans:\n        ans=temp\nprint(ans)\n", "passed": true, "time": 0.21, "memory": 14336.0, "status": "done"}, {"code": "n = int(input())\ns = input()\ncnt = 0\nfor i in range(1,n):\n    l = []\n    for j in s[:i]:\n        if j in s[i:]:\n            l.append(j)\n    l = set(l)\n    cnt = max(cnt,len(l))\n\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nans = 0\nfor i in range(N):\n    s1 = set(S[:i])\n    s2 = set(S[i:])\n    ans = max(len(s1 & s2), ans)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14280.0, "status": "done"}, {"code": "n=int(input())\ns=input()\ncount = 0\nfor i in range(n-1):\n  a=s[:i + 1]\n  b=s[i+1:]\n  temp = 0\n  for j in range(27):\n    if chr(96+j) in a and chr(96+j) in b:\n      temp += 1\n  count = max(temp, count)\nprint(count)", "passed": true, "time": 0.23, "memory": 14076.0, "status": "done"}, {"code": "def main():\n    n = int(input())\n    s = input()\n    ans = 0\n\n    for i in range(1, n):\n        cnt = 0\n        x, y = set(s[:i]), set(s[i:])\n        for j in x:\n            if j in y:\n                cnt += 1\n        ans = max(ans, cnt)\n\n    print(ans)\n\n\nmain()", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nans = 0\nfor i in range(1,n):\n  cnt = 0\n  l = set(s[:i])\n  r = set(s[i:])\n  for v in l:\n    if v in r:\n      cnt += 1\n  ans = max(ans,cnt)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "#\n# abc096 b\n#\nimport sys\nfrom io import StringIO\nimport unittest\n\n\nclass TestClass(unittest.TestCase):\n    def assertIO(self, input, output):\n        stdout, stdin = sys.stdout, sys.stdin\n        sys.stdout, sys.stdin = StringIO(), StringIO(input)\n        resolve()\n        sys.stdout.seek(0)\n        out = sys.stdout.read()[:-1]\n        sys.stdout, sys.stdin = stdout, stdin\n        self.assertEqual(out, output)\n\n    def test_\u5165\u529b\u4f8b_1(self):\n        input = \"\"\"6\naabbca\"\"\"\n        output = \"\"\"2\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_2(self):\n        input = \"\"\"10\naaaaaaaaaa\"\"\"\n        output = \"\"\"1\"\"\"\n        self.assertIO(input, output)\n\n    def test_\u5165\u529b\u4f8b_3(self):\n        input = \"\"\"45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir\"\"\"\n        output = \"\"\"9\"\"\"\n        self.assertIO(input, output)\n\n\ndef resolve():\n    N = int(input())\n    S = input()\n\n    ans = 0\n    for i in range(1, N-1):\n        x = set(S[0:i])\n        y = set(S[i:])\n        ans = max(ans, len(x & y))\n\n    print(ans)\n\n\ndef __starting_point():\n    # unittest.main()\n    resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14428.0, "status": "done"}, {"code": "def al_cnt(k,s):\n    count = 0\n    if 'a' in s[:k] and 'a' in s[k:]:\n        count += 1\n    if 'b' in s[:k] and 'b' in s[k:]:\n        count += 1\n    if 'c' in s[:k] and 'c' in s[k:]:\n        count += 1\n    if 'd' in s[:k] and 'd' in s[k:]:\n        count += 1\n    if 'e' in s[:k] and 'e' in s[k:]:\n        count += 1\n    if 'f' in s[:k] and'f' in s[k:]:\n        count += 1\n    if 'g' in s[:k] and 'g' in s[k:]:\n        count += 1\n    if 'h' in s[:k] and 'h' in s[k:]:\n        count += 1\n    if 'i' in s[:k] and 'i' in s[k:]:\n        count += 1\n    if 'j' in s[:k] and 'j' in s[k:]:\n        count += 1\n    if 'k' in s[:k] and 'k' in s[k:]:\n        count += 1\n    if 'l' in s[:k] and 'l' in s[k:]:\n        count += 1\n    if 'm' in s[:k] and 'm' in s[k:]:\n        count += 1\n    if 'n' in s[:k] and 'n' in s[k:]:\n        count += 1\n    if 'o' in s[:k] and 'o' in s[k:]:\n        count += 1\n    if 'p' in s[:k] and 'p' in s[k:]:\n        count += 1\n    if 'q' in s[:k] and 'q' in s[k:]:\n        count += 1\n    if 'r' in s[:k] and 'r' in s[k:]:\n        count += 1\n    if 's' in s[:k] and 's' in s[k:]:\n        count += 1\n    if 't' in s[:k] and 't' in s[k:]:\n        count += 1\n    if 'u' in s[:k] and 'u' in s[k:]:\n        count += 1\n    if 'v' in s[:k] and 'v' in s[k:]:\n        count += 1\n    if 'w' in s[:k] and 'w' in s[k:]:\n        count += 1\n    if 'x' in s[:k] and 'x' in s[k:]:\n        count += 1\n    if 'y' in s[:k] and 'y' in s[k:]:\n        count += 1\n    if 'z' in s[:k] and 'z' in s[k:]:\n        count += 1\n    return count\nn = int(input())\ns = input()\nans = 0\nfor i in range(1,n-1):\n    temp = al_cnt(i,s)\n    ans = max(ans,temp)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N = int(input())\nS = str(input())\n_sum = 0\nvisited = set()\n_sum_visited = set()\nmax_size = len(set(S))\n\n\nfor n in range(N-1):\n  if S[n] in S[n+1:] and (S[n] not in visited):\n    _sum += 1\n  \n  elif S[n] in visited and (S[n] not in S[n+1:]):\n    _sum -= 1\n  \n  visited.add(S[n])\n  _sum_visited.add(_sum)\n  last_size = len(set(S[n+1]))\n  ans = max(_sum_visited)\n  if ans == max_size:\n    break\n    \nprint(max(_sum_visited))", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N=int(input())\nS=input()\n\nans = 0\nfor i in range(N):\n\ts1,s2=set(S[:i]),set(S[i:])\n\ttmp = len(s1.intersection(s2))\n\tif tmp > ans:ans=tmp\n\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\nS = input()\n\nans = 0\nfor i in range(1, n):\n    X, Y = S[:i], S[i:]\n    cnt = 0\n    for x in set(X):\n        if x in Y:\n            cnt += 1\n    ans = max(cnt, ans)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14372.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nmax_count = 0\nfor i in range(0, N-1):\n  X = S[0:i+1]\n  Y = S[i+1:]\n\n  X_set = set(X)\n  Y_set = set(Y)\n\n  count = len(X_set & Y_set)\n  if max_count < count:\n    max_count = count\n\nprint(max_count)\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nprint(max(len((set(S[:i]) & set(S[i:]))) for i in range(1, N)))", "passed": true, "time": 0.23, "memory": 14168.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\n\nres = 0\n\nfor i in range(1, N):\n    cnt = set(S[0:i]) & set(S[i:N])\n    if res < len(cnt):\n        res = len(cnt)\n\nprint(res)", "passed": true, "time": 0.23, "memory": 14152.0, "status": "done"}, {"code": "n=int(input())\ns=input()\ncount_list=[]\n\nfor i in range(1,n):\n    x=s[:i]\n    y=s[i:]\n    xset=set(x)\n    xlist=list(xset)\n    count=0\n    for j in xlist:\n        if j in y:\n            count+=1\n    count_list.append(count)\n\n\nprint((max(count_list)))            \n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nmax_count = 0\n\nfor i in range(1, n):\n    s1 = ''.join(set(s[:i]))\n    s2 = ''.join(set(s[i:]))\n    count = 0\n    for j in range(len(s1)):\n        if s1[j] in s2:\n            count += 1\n    if count > max_count:\n        max_count = count\nprint(max_count)", "passed": true, "time": 0.15, "memory": 14320.0, "status": "done"}, {"code": "from collections import Counter\nN = int(input())\nS = input()\nans = 0\nfor i in range(N):\n    d1 = Counter(S[:i])\n    d2 = Counter(S[i:])\n    tmp = 0\n    for alphabet in 'abcdefghijklmnopqrstuvwxyz':\n        tmp += min(d1[alphabet], d2[alphabet], 1)\n    print\n    ans = max(ans, tmp)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14232.0, "status": "done"}, {"code": "N=int(input())\nS=input()\ntmp=0\nans=0\nfor i in range(N):\n    A=set(S[:i])\n    B=set(S[i:N])\n    AB=A & B\n    tmp=len(AB)\n    if tmp > ans:\n        ans=tmp\nprint(ans)\n            \n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "n=int(input())\ns=input()\n\nresult = 0\nfor i in range(1,n):\n  x = s[:i]\n  y = s[i:]\n  x_set = set(x)\n  y_set = set(y)\n  num = x_set & y_set\n  result = max(result, len(num))\nprint(result)\n", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "n=int(input())\ns=input()\ntmp,ans=0,0\nfor i in range(n+1):\n    s0=[]\n    for j in range(n):\n        if j<i:\n            t=True\n            for x in s0:\n                if x==s[j]:t=False\n            if t:s0.append(s[j])\n        else:\n            for k in range(len(s0)):\n                if s0[k]==s[j]:\n                    tmp+=1\n                    s0[k]=-1\n    #print(i,tmp)\n    tmp,ans=0,max(ans,tmp)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "input()\nS = input()\n\nprint(max(len(set(S[:i]) & set(S[i:])) for i in range(len(S))))", "passed": true, "time": 0.22, "memory": 14264.0, "status": "done"}, {"code": "n=int(input())\ns=input()\ndata=[]\nans=0\nfor i in range(n-1):\n  if s[i] not in data:\n    data.append(s[i])\n  res=0\n  for j in data:\n    if j in s[i+1:n]:\n      res+=1\n  ans=max(ans,res)\nprint(ans)", "passed": true, "time": 0.22, "memory": 14128.0, "status": "done"}, {"code": "N = int(input())\nN_List = list(map(str,input().strip()))\nans = 0\nfor i in range(1,N):\n    c_ans = len(set(N_List[:i]) & set(N_List[i:]))\n    if c_ans > ans:\n        ans = c_ans\nprint(ans)", "passed": true, "time": 0.21, "memory": 14224.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nlist_intersection = []\n\nfor i in range(1, n + 1):\n    a = set(s[:i])\n    b = set(s[i:])\n    intersection_a_b = a.intersection(b)\n    list_intersection.append(len(intersection_a_b))\n\nprint(max(list_intersection))", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "# len(set) \u611a\u76f4\nn = int(input())\ns = list(input())\nans = 0\nfor i in range(1, n):\n    x, y = set(s[:i]), set(s[i:])\n    ans = max(ans, len(x & y))\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\ns = input()\n\nresult = 0\nfor i in range(N - 1):\n  a = set(s[:i])\n  b = set(s[i:])\n  result = max(result, len(a & b))\n  \nprint(result)", "passed": true, "time": 0.25, "memory": 14260.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nans = 0\nfor i in range(1,n-1):\n  a = set(s[:i])\n  b = set(s[i:])\n  q = max(len(a),len(b))\n  t = 0\n  if ans >= q:\n      continue\n  if len(a) >= len(b):\n    w = list(a)\n    h = list(b)\n  else:\n    w = list(b)\n    h = list(a)\n  for k in range(q):\n    if w[k] in h:\n      t += 1\n  ans = max(ans,t)\nprint(ans)", "passed": true, "time": 0.16, "memory": 14316.0, "status": "done"}, {"code": "n=int(input())\ns = list(input())\nwd = list(\"abcdefghijklmnopqrstuvwxyz\")\nans=0\nfor i in range(n):\n  s1 = set(s[:i])\n  s2=set(s[i:])\n  tmp=0\n  for w in wd:\n    if w in s1 and w in s2:\n      tmp+=1\n  ans=max(ans,tmp)\nprint(ans)\n", "passed": true, "time": 0.24, "memory": 14168.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nmatch = []\nfor i in range(1,len(s)):\n    s1 = list(s[:i])\n    s2 = list(s[i:])\n    cnts = []\n    for j in s1:\n        if j in s2:\n            if j not in cnts:\n                cnts.append(j)\n    match.append(len(cnts))\nprint(max(match))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n = int(input())\na = input()\ndic=\"abcdefghijklmnopqrstuvwxyz\"\nmaxcount = 0\nfor i in range(n):\n  count = 0\n  for j in range(26):\n    if str(dic[j]) in a[:i] and str(dic[j]) in a[i:]:\n      count+=1\n  maxcount = max(count,maxcount)\nprint(maxcount)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nalh=\"abcdefghijklmnopqrstuvwxyz\"\nmax=0\nfor i in range(n):\n  front=s[:i]\n  rear=s[i:]\n  cnt=0\n  for j in alh:\n    if j in front and j in rear:\n      cnt+=1\n  if cnt>max:\n    max=cnt\nprint(max)", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nprint(max([len(set(S[:i]) & set(S[i:])) for i in range(N)]))", "passed": true, "time": 0.15, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\ns = input()\na = []\nfor i in range(1, n):\n  a.append(len(set(s[:i]) & set(s[i:])))\nprint(max(a))", "passed": true, "time": 0.23, "memory": 14136.0, "status": "done"}, {"code": "# ABC098\n\nN = int(input())\nS = input()\nans = 0\nfor i in range(len(S)):\n    left = set(S[0:i])\n    right = set(S[i:len(S)])\n\n    ans = max(ans, len(left & right))\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\nans = []\nfor i in range(1, n):\n    first_falf = set(s[:i])\n    after_falf = set(s[i:])\n    count = 0\n    for word in first_falf:\n        if word in after_falf:\n            count += 1\n    ans.append(count)\nprint((max(ans)))\n", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n = int(input())\ns = str(input())\nans = 0\n\nfor i in range(1,n):\n    l = list(s[0:i])\n    r = list(s[i:n])\n    dup = len(set(l)&set(r))\n\n    if ans < dup:\n        ans = dup\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n = int(input())\ns = list(map(str,input()))\nansl = []\nfor i in range(1,n):\n  ans = 0\n  x = list(set(s[:i]))\n  y = list(set(s[i:]))\n  for j in range(len(x)):\n    if x[j] in y:\n      ans += 1\n  ansl.append(ans)\nprint(max(ansl))", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\nS = list(input())\nans = 0\n\nfor i in range(1,n-1):\n  L = S[:i]\n  R = S[i:]\n  UL = set(L)\n  UR = set(R)\n  ans = max(ans, len(UL & UR))\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nr = 0\nfor i in range(1, N):\n  s1 = S[:i]\n  s2 = S[i:]\n  r = max(len(set(s1) & set(s2)), r)\n\nprint(r)\n", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nshurui=[]\nfor i in range(len(s)-1):\n  zenhan=s[0:i+1]\n  kouhan=s[i+1:len(s)]\n  kaburu=[]\n  kaburu.clear()\n  a=0\n  for j in range(len(zenhan)):\n    if kouhan.count(zenhan[j]) != 0 and kaburu.count(zenhan[j])==0:\n      a+=1\n      kaburu.append(zenhan[j])\n  shurui.append(a)\nprint((max(shurui)))\n", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "_ = input()\nS = input()\n\nprint(max(len(set(S[:i]) & set(S[i:])) for i in range(len(S))))", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "N = int(input())\ns = input()\n\ndef count(x, y):\n   l= []\n   result = 0\n   for i in range(len(x + y)):\n      l.append((x + y)[i])\n   for letter in set(l):\n      if (letter in x) and (letter in y):\n         result += 1\n   return result\n\nlst = []\nfor i in range(1, N):\n   lst.append(count(s[:i], s[i:]))\n\nprint(max(lst))", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\n\nprint(max([len(set(S[:i]) & set(S[i:])) for i in range(N)]))", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nss = []\nfor s in S:\n    if s not in ss:\n        ss.append(s)\n\nmax_count = 0\nfor i in range(1, N-1):\n    count = 0\n    for s in ss:\n        x = S[0:i]\n        y = S[i:N]\n        if s in x and s in y:\n            count += 1\n    if count > max_count:\n        max_count = count\n\nprint(max_count)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "N=int(input())\nS=input()\n\nans=0\nfor i in range(N):\n    X=S[0:i]\n    Y=S[i:N] \n    XY=set(X) & set(Y)\n    cnt=len(XY)\n    ans=max(ans,cnt)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools\nfrom collections import deque\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\nDR = [1, -1, 0, 0]\nDC = [0, 0, 1, -1]\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef I(): return int(sys.stdin.readline())\ndef F(): return float(sys.stdin.readline())\ndef S(): return input()\n     \ndef main():\n    N = I()\n    s = S()\n    ans = 0\n    for i in range(N):\n        a = s[:i]\n        b = s[i:]\n        c = len(set(a).intersection(set(b)))\n        ans = max(c, ans)\n    print(ans)\n\n\nmain()\n\n", "passed": true, "time": 0.15, "memory": 14324.0, "status": "done"}, {"code": "def answer(n: int, s: str) -> int:\n    result = 0\n    for i in range(1, n):\n        x = set(s[i:])\n        y = set(s[:i])\n        common_characters = x.intersection(y)\n        result = max(result, len(common_characters))\n\n    return result\n\ndef main():\n    n = int(input())\n    s = input()\n    print((answer(n,s)))\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "\nN = int(input())\nS = input()\n\nans = 0\n\nfor i in range(N-1):\n    L = S[:i+1]\n    R = S[i+1:]\n    c = 0\n    for l in set(L):\n        if l in R:\n            c += 1\n\n    ans = max(ans, c)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "def calc_intersection():\n    n = int(input())\n    s = input()\n    list_intersection = []\n\n    for i in range(1, n):\n        a = set(s[:i])\n        b = set(s[i:])\n        intersection_a_b = a.intersection(b)\n        list_intersection.append(len(intersection_a_b))\n    return max(list_intersection)\n\n\ndef __starting_point():\n    print(calc_intersection())\n__starting_point()", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}]