N=int(eval(input()))

S=eval(input())



L0=[]

L1=[]

ans=[]



for i in range(N-2):

    if S[i] in L0:

        continue

    else:

        L0.append(S[i])

    for j in range(i+1,N-1):

        temp=S[i]+S[j]

        if temp in L1:

            continue

        else:

            L1.append(temp)

        for k in range(j+1,N):

            ans.append(temp+S[k])





print((len(set(ans))))
N=int(eval(input()))

S=eval(input())

L=len(S)



cnt=0

for i in range(1000):

    key=str(i).zfill(3)

    if key[0] in S:

        idx1=S.index(key[0])

    else:

        continue

    if key[1] in S[idx1+1:L-1]:

        idx2=S[idx1+1:L-1].index(key[1])+idx1+2

    else:

        continue

    if key[2] in S[idx2:L]:

        cnt+=1

    else:

        continue



print(cnt)

N = int(eval(input()))
S = eval(input())
L0 = []
L1 = []
ans = []
for i in range(N - 2):
    if S[i] in L0:
        continue
    else:
        L0.append(S[i])
    for j in range(i + 1, N - 1):
        temp = S[i] + S[j]
        if temp in L1:
            continue
        else:
            L1.append(temp)
        for k in range(j + 1, N):
            ans.append(temp + S[k])
print((len(set(ans))))

N = int(eval(input()))
S = eval(input())
L = len(S)
cnt = 0
for i in range(1000):
    key = str(i).zfill(3)
    if key[0] in S:
        idx1 = S.index(key[0])
    else:
        continue
    if key[1] in S[idx1 + 1 : L - 1]:
        idx2 = S[idx1 + 1 : L - 1].index(key[1]) + idx1 + 2
    else:
        continue
    if key[2] in S[idx2:L]:
        cnt += 1
    else:
        continue
print(cnt)

-L0 = [] -L1 = [] -ans = [] -for i in range(N - 2): -    if S[i] in L0: +L = len(S) +cnt = 0 +for i in range(1000): +    key = str(i).zfill(3) +    if key[0] in S: +        idx1 = S.index(key[0]) +    else: +    if key[1] in S[idx1 + 1 : L - 1]: +        idx2 = S[idx1 + 1 : L - 1].index(key[1]) + idx1 + 2 -        L0.append(S[i]) -    for j in range(i + 1, N - 1): -        temp = S[i] + S[j] -        if temp in L1: -            continue -        else: -            L1.append(temp) -        for k in range(j + 1, N): -            ans.append(temp + S[k]) -print((len(set(ans)))) +        continue +    if key[2] in S[idx2:L]: +        cnt += 1 +    else: +        continue +print(cnt)