Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin letters.

Let A be a set of positions in the string. Let's call it pretty if following conditions are met:  letters on positions from A in the string are all distinct and lowercase;  there are no uppercase letters in the string which are situated between positions from A (i.e. there is no such j that s[j] is an uppercase letter, and a_1 < j < a_2 for some a_1 and a_2 from A). 

Write a program that will determine the maximum number of elements in a pretty set of positions.


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 200) — length of string s.

The second line contains a string s consisting of lowercase and uppercase Latin letters.


-----Output-----

Print maximum number of elements in pretty set of positions for string s.


-----Examples-----
Input
11
aaaaBaabAbA

Output
2

Input
12
zACaAbbaazzC

Output
3

Input
3
ABC

Output
0



-----Note-----

In the first example the desired positions might be 6 and 8 or 7 and 8. Positions 6 and 7 contain letters 'a', position 8 contains letter 'b'. The pair of positions 1 and 8 is not suitable because there is an uppercase letter 'B' between these position.

In the second example desired positions can be 7, 8 and 11. There are other ways to choose pretty set consisting of three elements.

In the third example the given string s does not contain any lowercase letters, so the answer is 0.

Difficulty: interview

Starter code:

Solutions:
def list_input():
    return list(map(int,input().split()))
def map_input():
    return map(int,input().split())
def map_string():
    return input().split()
    
n = int(input())    
a = list(input())
ans = 0
for i in range(n):
	for j in range(i,n):
		b = a[i:j+1]
		for k in b:
			if k.lower() != k:
				break
		else:
			b = set(b)
			ans = max(ans,len(b))
print(ans)					

n = int(input())

s = input()

ans = 0
ss = set()

for c in s:
	if c.isupper():
		ans = max(ans, len(ss))
		ss = set()
	else:
		ss.add(c)
ans = max(ans, len(ss))
print(ans)

n = int(input())
b = input()
a = ['']
for i in b:
    if ord('A') <= ord(i) <= ord('Z'):
        a.append('')
    else:
        a[-1] = a[-1] + i
a = [len(set(list(i))) for i in a]
print(max(a))

n = int(input())

ans = 0
l = []

for c in input():
    if c.islower():
        l.append(c)
    else:
        ans = max(ans, len(set(l)))
        l = []

ans = max(ans, len(set(l)))
print(ans)


n = int(input())
s= input()
import string
sm = string.ascii_lowercase
b = string.ascii_uppercase
ans = 0
h = set()
for i in range(len(s)):
    if s[i] in sm:
        h.add(s[i])
        ans = max(ans, len(h))
    else:
        h = set()
print(ans)

n=input()
s=input()
z=''
for c in s:
	if ord(c)>=ord('a') and ord(c)<=ord('z'):
		z+=c
	else:
		z+=' '
z=z.split(' ')
alp=range(26)
res=0
for w in z:
	kek=26
	for x in alp:
		if w.find(chr(ord('a')+x))==-1:
			kek-=1
	res=max(res,kek)
print(res)

from sys import stdin, stdout
import string

n = int(stdin.readline().rstrip())
s = list(stdin.readline().rstrip())

lset = str(string.ascii_lowercase)
uset = str(string.ascii_uppercase)

currentSet = set()
maxSize = 0
for letter in s:
    if letter in uset:
        currentSet = set()
    else:
        currentSet.add(letter)
        maxSize = max(maxSize,len(currentSet))
        
print(maxSize)


import re
n=int(input())
s=input()
ans=0
for c in re.split('[A-Z]',s):
	if len(c)>0:
		ans=max(ans,len(set(c)))

print(ans)


def bitLenCount(x):
        length = 0
        count = 0
        while (x):
            count += (x & 1)
            length += 1
            x >>= 1
        return count

n = input()
s = input()
msk = 0
ans = 0
for i in s:
	x = ord(i) - ord('a')
	
	if x >= 0 and x <= 25:
		msk |= (1 << x)
	else:
		msk = 0
	ans = max(ans, bitLenCount(msk))
	
print(ans)

import re
n = int(input())
S = input().strip()
s = re.split(r'[A-Z]+', S)
m = 0
for ss in s:
    x = set(ss)
    m = max(m, len(x))
print(m)

n = int(input())
s = input()

ans = 0
now_ans = 0
lower = []

for el in s:
    if el.islower():
        if el not in lower:
            lower.append(el)
            now_ans += 1
    else:
        if now_ans > ans:
            ans = now_ans
        lower = []
        now_ans = 0

if now_ans > ans:
    ans = now_ans

print(ans)

input()

ll = list(input())

dd = {}


def is_up(s):
    return s.lower() != s


def is_lo(s):
    return s.lower() == s


ma = 0


for i in range(len(ll)):
    if is_up(ll[i]):
        dd = {}
    else:
        c = ll[i]
        if c not in dd:
            dd[c] = 1
        ma = max(len(dd), ma)

ma = max(len(dd), ma)

print(ma)


import re
n=int(input())
s=input()
a=re.split('[A-Z]+',s)
ans=0
for i in a:
	ans=max(ans,len(set(i)))
print(ans)

n = int(input())
s = input()
a = [set()]
k = 0
for i in range(len(s)):
    if s[i].upper() == s[i] and a[-1] != set():
        k += 1
        a.append(set())
    else:
        if s[i].lower() == s[i] and s[i] not in a[-1]:
            a[-1].add(s[i])
print(max([len(x) for x in a]))


input()
s = input()
arr = []
temp = ''
for x in s:
	if(ord(x) <= ord('Z')):
		if(temp != ''):
			arr.append(temp)
			temp = ''
	else:
		temp += x
if(temp != ''):
	arr.append(temp)

ans = 0
for y in arr:
	ans = max(ans, len(set(list(y))))
print(ans)

n = int(input())
s = str(input())

res = [[]]

for i in s:
	if ord(i) >= ord('A') and (ord(i)) <= ord('Z'):
		res.append([])
	else:
		res[-1].append(i)

mx = 0

for i in res:
	mx = max(mx, len(set(i)))

print(mx)

import re

n = int(input())
s = input()
print(max([len(set(x)) for x in re.split('[A-Z]', s)]))


def solve():

    n = int(input())
    sentence = input()

    alpha = "abcdefghijklmnopqrstuvwxyz"
    alp = [[]]
    
    for st in sentence:
        if st in alpha:
            if st not in alp[-1]:
                alp[-1].append(st)
        else:
            alp.append([])

    #print(alp)
    return max([len(e) for e in alp])

print(solve())


import re
n = int(input())
s = input()
ans = 0
ss = re.split(r'[A-Z]+', s)
print(max(list(map(len, list(map(set, ss))))))

"""
11
aaaaBAAAVDAaabAbA
"""


size = int(input())
n = input()

rez = []
ans = 0
yet = 0

for i in n:
    if ord(i) > 96 and i not in rez:
        rez.append(i)
        yet += 1
    elif ord(i) < 96:
        rez = []
        yet = 0
    ans = max(ans,yet)

print(ans)


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
"""

# import {{{
from collections import ChainMap
from collections import Counter
from collections import defaultdict
from collections import deque
from collections import namedtuple
import bisect
import copy
import decimal
import fractions
import functools
import heapq
import itertools
import math
import operator
import pprint
import random
import re
import sys
import time

try:
    import numpy as np
    import scipy as sp
except:
    pass
# }}}

# util {{{
def is_odd(x):
    return x % 2 == 1

def is_even(x):
    return x % 2 == 0

def cmp(x, y):
    return (x > y) - (x < y)

def sgn(x):
    return cmp(x, 0)

def clamp(x, lo, hi):
    assert lo <= hi
    if x < lo:
        return lo
    elif x > hi:
        return hi
    else:
        return x

def chmax(xmax, x):
    if x > xmax:
        return x, True
    else:
        return xmax, False

def chmin(xmin, x):
    if x < xmin:
        return x, True
    else:
        return xmin, False

sys.setrecursionlimit(100000)
# }}}

# 適宜調整
PINF = float("inf")
NINF = float("-inf")
EPS  = 1e-9



def main():
    N = int(input())
    S = input()

    sets = []

    s = set()
    for c in S:
        if c.isupper():
            if s:
                sets.append(s)
            s = set()
        else:
            s.add(c)
    if s:
        sets.append(s)

    ans = len(max(sets, key=len)) if sets else 0
    print(ans)

def __starting_point(): main()

__starting_point()

n=int(input())
s=str(input())
l=[0]
for i in range(len(s)):
    if ord(s[i])>=65 and ord(s[i])<=90:
        l.append(i)
ans=0
l.append(n)
for i in range(len(l)-1):
    ls=[]
    for j in range(l[i],l[i+1]):
        if s[j] not in ls and (ord(s[j])>=97 and ord(s[j])<=122):
            ls.append(s[j])
    ans=max(ans,len(ls))
    #print(ls)
print(ans)

# O(nlogn)
def main():
  n = int(input())
  s = input()
  
  low_chars = set()
  max_power = 0
  for c in s:
    if c.isupper():
      max_power = max(max_power, len(low_chars))
      low_chars = set()
    else:
      low_chars.add(c)
      
  if len(low_chars) > 0:
    max_power = max(max_power, len(low_chars))
    
  print(max_power)
  
main()


_ = int(input())
s = input()
chars = set()
maxval = 0
for c in s:
  if c.isupper():
    maxval = max(maxval, len(chars))
    chars = set()
  else:
    chars.add(c)
maxval = max(maxval, len(chars))

print(maxval)

input()
s=input()
x=set()
a=0
l=len(s)
for i in range(0,l):
  for j in range(i,l):
    ss=s[i:j+1]
    if any(chr(i) in ss for i in range(65, 91)):
      continue
    a=max(a,len(set(ss)))
print(a)