n = int(eval(input()))

s = eval(input())



ans = 0



for i in range(10):

    a = s.find(str(i))

    if a == -1:

        continue

    for j in range(10):

        b = s.find(str(j), a + 1)

        if b == -1:

            continue

        for k in range(10):

            c = s.find(str(k), b + 1)

            if c == -1:

                continue

            ans += 1

print(ans)
def main():

    n = int(eval(input()))

    s = eval(input())



    ans = 0



    for i in range(10):

        a = s.find(str(i))

        if a == -1:

            continue

        for j in range(10):

            b = s.find(str(j), a + 1)

            if b == -1:

                continue

            for k in range(10):

                c = s.find(str(k), b + 1)

                if c == -1:

                    continue

                ans += 1

    print(ans)





if __name__ == "__main__":

    main()
n = int(eval(input()))
s = eval(input())
ans = 0
for i in range(10):
    a = s.find(str(i))
    if a == -1:
        continue
    for j in range(10):
        b = s.find(str(j), a + 1)
        if b == -1:
            continue
        for k in range(10):
            c = s.find(str(k), b + 1)
            if c == -1:
                continue
            ans += 1
print(ans)

def main():
    n = int(eval(input()))
    s = eval(input())
    ans = 0
    for i in range(10):
        a = s.find(str(i))
        if a == -1:
            continue
        for j in range(10):
            b = s.find(str(j), a + 1)
            if b == -1:
                continue
            for k in range(10):
                c = s.find(str(k), b + 1)
                if c == -1:
                    continue
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-n = int(eval(input())) -s = eval(input()) -ans = 0 -for i in range(10): -    a = s.find(str(i)) -    if a == -1: -        continue -    for j in range(10): -        b = s.find(str(j), a + 1) -        if b == -1: +def main(): +    n = int(eval(input())) +    s = eval(input()) +    ans = 0 +    for i in range(10): +        a = s.find(str(i)) +        if a == -1: -        for k in range(10): -            c = s.find(str(k), b + 1) -            if c == -1: +        for j in range(10): +            b = s.find(str(j), a + 1) +            if b == -1: -            ans += 1 -print(ans) +            for k in range(10): +                c = s.find(str(k), b + 1) +                if c == -1: +                    continue +                ans += 1 +    print(ans) + + +if __name__ == "__main__": +    main()