n = int(eval(input()))

num = eval(input())

 

password_list = []

initial_list = []

initial_list2 = []

initial_list3 = []

 

for i in range(len(num)-2):

    initial_list2 = []

    if num[i] in initial_list:

        continue

    elif len(initial_list) == 10:

        break

    else:

        initial_list.append(num[i])

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

            initial_list3 = []

            if num[j] in initial_list2:

                continue

            elif len(initial_list2) == 10:

                break

            else:

                initial_list2.append(num[j])

                for k in range(j+1,len(num)):

                    if num[k] in initial_list3:

                        continue

                    elif len(initial_list3) == 10:

                        break

                    else:

                        initial_list3.append(num[k])

                        target = num[i] + num[j] + num[k]

                        if target not in password_list:

                            password_list.append(target)

                            

print((len(password_list)))
n = int(eval(input()))

num_list = list(map(int,eval(input())))



cnt = 0



for i in range(10):

    if i not in num_list:

        continue

    else:

        first_pwd = num_list.index(i)

        new_num_list = num_list[first_pwd + 1:]

        for j in range(10):

            if j not in new_num_list:

                continue

            else:

                second_pwd = new_num_list.index(j)

                new_new_num_list = new_num_list[second_pwd+1:]

                for k in range(10):

                    if k not in new_new_num_list:

                        continue

                    else:

                        cnt += 1



print(cnt)
n = int(eval(input()))
num = eval(input())
password_list = []
initial_list = []
initial_list2 = []
initial_list3 = []
for i in range(len(num) - 2):
    initial_list2 = []
    if num[i] in initial_list:
        continue
    elif len(initial_list) == 10:
        break
    else:
        initial_list.append(num[i])
        for j in range(i + 1, len(num) - 1):
            initial_list3 = []
            if num[j] in initial_list2:
                continue
            elif len(initial_list2) == 10:
                break
            else:
                initial_list2.append(num[j])
                for k in range(j + 1, len(num)):
                    if num[k] in initial_list3:
                        continue
                    elif len(initial_list3) == 10:
                        break
                    else:
                        initial_list3.append(num[k])
                        target = num[i] + num[j] + num[k]
                        if target not in password_list:
                            password_list.append(target)
print((len(password_list)))

n = int(eval(input()))
num_list = list(map(int, eval(input())))
cnt = 0
for i in range(10):
    if i not in num_list:
        continue
    else:
        first_pwd = num_list.index(i)
        new_num_list = num_list[first_pwd + 1 :]
        for j in range(10):
            if j not in new_num_list:
                continue
            else:
                second_pwd = new_num_list.index(j)
                new_new_num_list = new_num_list[second_pwd + 1 :]
                for k in range(10):
                    if k not in new_new_num_list:
                        continue
                    else:
                        cnt += 1
print(cnt)

-num = eval(input()) -password_list = [] -initial_list = [] -initial_list2 = [] -initial_list3 = [] -for i in range(len(num) - 2): -    initial_list2 = [] -    if num[i] in initial_list: +num_list = list(map(int, eval(input()))) +cnt = 0 +for i in range(10): +    if i not in num_list: -    elif len(initial_list) == 10: -        break -        initial_list.append(num[i]) -        for j in range(i + 1, len(num) - 1): -            initial_list3 = [] -            if num[j] in initial_list2: +        first_pwd = num_list.index(i) +        new_num_list = num_list[first_pwd + 1 :] +        for j in range(10): +            if j not in new_num_list: -            elif len(initial_list2) == 10: -                break -                initial_list2.append(num[j]) -                for k in range(j + 1, len(num)): -                    if num[k] in initial_list3: +                second_pwd = new_num_list.index(j) +                new_new_num_list = new_num_list[second_pwd + 1 :] +                for k in range(10): +                    if k not in new_new_num_list: -                    elif len(initial_list3) == 10: -                        break -                        initial_list3.append(num[k]) -                        target = num[i] + num[j] + num[k] -                        if target not in password_list: -                            password_list.append(target) -print((len(password_list))) +                        cnt += 1 +print(cnt)