Buggy python submission (verdict: Time Limit Exceeded):
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
ans1 = 0
for i in range(1000):
  ans = False
  for j in range(N):
    if S[j] == str(i).zfill(3)[0]:
      for k in range(j+1, N):
        if S[k] == str(i).zfill(3)[1]:
          for l in range(k+1, N):
            if S[l] == str(i).zfill(3)[2]:
              ans = True
              break
        if ans:
          break
    if ans:
      break
  if ans:
    ans1 += 1
print(ans1)

Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)


Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
input()
S = input()
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if int(s) == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)


Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
input()
S = input()
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if int(s) == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)


Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
input()
S = input()
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if int(s) == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
input()
S = input()
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if int(s) == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
input()
S = input()
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if int(s) == c[f]:f += 1
    if f==3:break 
  if f==3:cnt += 1
print(cnt)
    


Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
input()
S = input()
cnt = 0
for i in range(0, 1000):
  c = [i//100, (i//10)%10, i%10]
  f = 0
  for s in S:
    if int(s) == c[f]:f += 1
    if f==3:break 
  if f==3:cnt += 1
print(cnt)
    

Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
S = input()
cnt = 0
for i in range(0, 1000):
  c = [i//100, (i//10)%10, i%10]
  f = 0
  for j in range(len(S)):
    if int(S[j]) == c[f]:
      f += 1
    if f==3:
      break 
  if f==3:
    cnt += 1
print(cnt)

Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
d = n-3
ans = set()
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      ans.add(s[i]+s[j]+s[k])
print(len(ans))

Fixed submission:
input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)