#include<iostream>
#include<cstring>
using namespace std;
char s[100],c,cops[100];
int fr[100000000],sol,i,j;
long long nr;
int main()
{
	cin>>c>>c;
	cin>>s;
	strcpy(cops,s);
	for(i=0;i<=7;i++)
	{
		for(j=strlen(s);j>=i+1;j--)
			s[j]=s[j-1];
	//	cout<<s<<" ";
		for(j=0;j<=9;j++)
		{
			s[i]=j+'0';
			nr=atoi(s);
			if(fr[nr]==0)
			{
				sol++;
				fr[nr]++;
			}
		}
		strcpy(s,cops);
	}
	cout<<sol;
	return 0;
}