#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#define N 110
using namespace std;

char s[N], ss[N];

int main()
{
	char c;
	int j, k, temp, n, i, ans, flag;

	while (scanf_s("%d", &n) != EOF)
	{
		c = getchar();
		fgets(s, sizeof(s), stdin);
		s[n] = '\0';
		ans = 0;

		for (i = 1;i<n;i++)
		{
			strcpy_s(ss, s);
			temp = 0;

			for (j = 0;j<i&&j<n;j++)
			{
				flag = 1;

				for (k = i;k<n;k++)
				{
					if (ss[k] == s[j])
					{
						if (flag)
						{
							flag = 0;
							temp++;
						}

						ss[k] = '#';
					}
				}
			}

			ans = max(ans, temp);
		}

		printf("%d\n", ans);
	}

	return 0;
}