#include<stdio.h>
#include<stdlib.h>
char a[101];
int b[26] = {0};
int c[26] = {0};
int main(void)
{
	
	int n;
	while (scanf("%d",&n)!=EOF)
	{
		
		scanf("%s", a);
		printf("%s", a);
		int max=0;
		int num=0;
		for (int i = 0; i < n; i++)
		{
			for (int m = 0; m <= i; m++)
			{
				int v = (int)a[m] - 97;
				b[v]++;
			}
			for (int j = n - 1; j > i; j--)
			{
				
				for (int q = n - 1; q >= j; q--)
				{
					int h = (int)a[q] - 97;
					c[h]++;
				}
				
				for (int l = 0; l < 26; l++)
				{
					
					if (b[l] != 0 && c[l] != 0)
					{
						num++;
						
					}
				}
				if (num > max)
					max = num;
				num = 0;
				for (int q = 0; q < 26; q++)
				{
					c[q] = 0;
				}
			}
			for (int q = 0; q < 26; q++)
			{
				b[q] = 0;
			}
		}
		printf("%d\n", max);
	}
	
	return 0;
}