Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

cnt = 0

for i in range(1000):
    if 0 <= i < 10:
        a = "00" + str(i)
    elif 10 <= i < 100:
        a = "0" + str(i)
    elif 100 <= i:
        a = str(i)
    
    idx = 0
    for j in range(N):
        if S[j] == a[idx]:
            idx += 1
            if idx == 3:
                cnt += 1
                break

print(cnt)

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

cnt = 0

for i in range(1000):
    if 0 <= i < 10:
        a = "00" + str(i)
    elif 10 <= i < 100:
        a = "0" + str(i)
    elif 100 <= i:
        a = str(i)
    
    idx = 0
    for j in range(N):
        if S[i] == a[idx]:
            idx += 1
            if idx == 3:
                cnt += 1
                break

print(cnt)

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

cnt = 0

for i in range(1000):
    if 0 <= i < 10:
        a = "00" + str(i)
    elif 10 <= i < 100:
        a = "0" + str(i)
    elif 100 <= i:
        a = str(i)
    
    idx = 0
    for j in range(S):
        if S[i] == a[idx]:
            idx += 1
            if idx == 3:
                cnt += 1
                break

print(cnt)

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

cnt = 0

for i in range(1000):
    if 0 <= i < 10:
        a = "00" + str(i)
    elif 10 <= i < 100:
        a = "0" + str(i)
    elif 100 <= i:
        a = str(i)
    
    idx = 0
    for j in range(S):
        if S[i] == a[idx]:
            idx += 1
            if idx == 3:
                cnt += 1
                break

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for l in range(N):
                if int(S[l]) == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x = 3:
                        cnt += 1
                        break

print(cnt)

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            flag1 = True
            flag2 = True

            for a in S:
                if flag1:
                    if a == i:
                        flag1 = False
                elif flag2:
                    if a == j:
                        flag2 = False
                elif a == k:
                    cnt += 1
                    break

print(cnt)

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(map(int, list(input()))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            flag1 = True
            flag2 = True

            for a in S:
                if flag1:
                    if a == i:
                        flag1 = False
                elif flag2:
                    if a == j:
                        flag2 = False
                elif a == k:
                    cnt += 1
                    break

print(cnt)

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

L = []
flag1 = [0,1,2,3,4,5,6,7,8,9]

for i in range(N-2):
    x = int(S[i])
    if x in flag1:
        flag1[x] == 99999
    else:
        continue

    for j in range(i+1, N-1):
        for k in range(j+1, N):
            L.append(S[i] + S[j] + S[k])

print(len(set(L)))

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

L = []
flag1 = [0,1,2,3,4,5,6,7,8,9]
flag2 = [0,1,2,3,4,5,6,7,8,9]
flag3 = [0,1,2,3,4,5,6,7,8,9]

for i in range(N-2):
    x = int(S[i])
    if x in flag1:
        flag1[x] == 99999
    else:
        continue

    for j in range(i+1, N-1):
        y = int(S[j])
        if y in flag2:
            flag2[y] == 99999
        else:
            continue

        for k in range(j+1, N):
            z = int(S[k])
            if z in flag3:
                flag3[z] == 99999
            else:
                continue
            L.append(S[i] + S[j] + S[k])

print(len(set(L)))

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

L = []
flag1 = [0,1,2,3,4,5,6,7,8,9]
flag2 = [0,1,2,3,4,5,6,7,8,9]
flag3 = [0,1,2,3,4,5,6,7,8,9]

for i in range(N-2):
    x = int(S[i])
    if x in flag1:
        flag1[x] == 99999
    else:
        continue

    for j in range(i+1, N-1):
        y = int(S[j])
        if y in flag2:
            flag2[y] == 99999
        else:
            continue

        for k in range(j+1, N):
            z = int(S[k])
            if z in flag3:
                flag3[z] == 99999
            else:
                continue
            L.append(S[i] + S[j] + S[k])

print(len(set(L)))

Fixed submission:
N = int(input())
S = list(map(int, list(input())))

cnt = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            pin = [i, j, k]
            x = 0

            for a in S:
                if a == pin[x]:
                    x += 1
                    if x == 3:
                        cnt += 1
                        break

print(cnt)