Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=str(input())
ans=0
i=0
while i<1000:
  temp=i//100
  #temp.append(i//100)
  #temp.append((i-(i//100)*100)//10)
  #temp.append(i%10)
  cnt=0
  k=0
  for j in range(0,n):
    if temp==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==0:
    i=i+100
  else:
    temp=(i-(i//100)*100)//10
    for j in range(k+1,n):      
      if temp==int(s[j]):
        cnt=cnt+1
        k=j
        break
    if cnt==1:
      i=i+10
    else:
      temp=i%10
      i=i+1
      for j in range(k+1,n):
        if temp==int(s[j]):
          ans=ans+1
          break
print(ans)

Fixed submission:
n=int(input())
s=str(input())
ans=0
i=0
while i<1000:
  temp=i//100
  cnt=0
  k=0
  for j in range(0,n):
    if temp==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==0:
    i=i+100
  else:
    temp=(i-(i//100)*100)//10
    for j in range(k+1,n):      
      if temp==int(s[j]):
        cnt=cnt+1
        k=j
        break
    if cnt==1:
      i=i+10
    else:
      temp=i%10
      i=i+1
      for j in range(k+1,n):
        if temp==int(s[j]):
          ans=ans+1
          break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=str(input())
ans=0
for i in range(0,1000):
  temp=[]
  temp.append(i//100)
  temp.append((i-(i//100)*100)//10)
  temp.append(i%10)
  cnt=0
  k=0
  for j in range(0,n):
    if temp[0]==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==1:
    for j in range(k+1,n):      
      if temp[1]==int(s[j]):
        cnt=cnt+1
        k=j
        break
  if cnt==2:
    for j in range(k+1,n):
      if temp[2]==int(s[j]):
        ans=ans+1
        break
print(ans)

Fixed submission:
n=int(input())
s=str(input())
ans=0
i=0
while i<1000:
  temp=i//100
  cnt=0
  k=0
  for j in range(0,n):
    if temp==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==0:
    i=i+100
  else:
    temp=(i-(i//100)*100)//10
    for j in range(k+1,n):      
      if temp==int(s[j]):
        cnt=cnt+1
        k=j
        break
    if cnt==1:
      i=i+10
    else:
      temp=i%10
      i=i+1
      for j in range(k+1,n):
        if temp==int(s[j]):
          ans=ans+1
          break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=str(input())
ans=0
for i in range(0,1000):
  temp=[]
  temp.append(i//100)
  temp.append((i-(i//100)*100)//10)
  temp.append(i%10)
  cnt=0
  k=0
  for j in range(0,n):
    if cnt==0 and temp[0]==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==1:
    for j in range(k+1,n):      
      if temp[1]==int(s[j]):
        cnt=cnt+1
        k=j
        break
  if cnt==2:
    for j in range(k+1,n):
      if temp[2]==int(s[j]):
        ans=ans+1
        break
print(ans)

Fixed submission:
n=int(input())
s=str(input())
ans=0
i=0
while i<1000:
  temp=i//100
  cnt=0
  k=0
  for j in range(0,n):
    if temp==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==0:
    i=i+100
  else:
    temp=(i-(i//100)*100)//10
    for j in range(k+1,n):      
      if temp==int(s[j]):
        cnt=cnt+1
        k=j
        break
    if cnt==1:
      i=i+10
    else:
      temp=i%10
      i=i+1
      for j in range(k+1,n):
        if temp==int(s[j]):
          ans=ans+1
          break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=str(input())
ans=0
for i in range(0,1000):
  temp=[]
  temp.append(i//100)
  temp.append((i-(i//100)*100)//10)
  temp.append(i%10)
  cnt=0
  k=0
  for j in range(0,n):
    if cnt==0 and temp[0]==int(s[j]):
      cnt=cnt+1
      k=j
      break
  for j in range(k+1,n):      
    if cnt==1 and temp[1]==int(s[j]):
      cnt=cnt+1
      k=j
      break
  for j in range(k+1,n):
    if cnt==2 and temp[2]==int(s[j]):
      ans=ans+1
      break
print(ans)

Fixed submission:
n=int(input())
s=str(input())
ans=0
i=0
while i<1000:
  temp=i//100
  cnt=0
  k=0
  for j in range(0,n):
    if temp==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==0:
    i=i+100
  else:
    temp=(i-(i//100)*100)//10
    for j in range(k+1,n):      
      if temp==int(s[j]):
        cnt=cnt+1
        k=j
        break
    if cnt==1:
      i=i+10
    else:
      temp=i%10
      i=i+1
      for j in range(k+1,n):
        if temp==int(s[j]):
          ans=ans+1
          break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=str(input())
ans=0
for i in range(0,1000):
  temp=[]
  temp.append(i//100)
  temp.append((i-(i//100)*100)//10)
  temp.append(i%10)
  cnt=0
  k=0
  for j in range(0,n):
    if cnt==0 and temp[0]==int(s[j]):
      cnt=cnt+1
      k=j
      break
  for j in range(k+1,n):      
    if cnt==1 and temp[1]==int(s[j]):
      cnt=cnt+1
      k=j
  for j in range(k+1,n):
    if cnt==2 and temp[2]==int(s[j]):
      ans=ans+1
      break
print(ans)

Fixed submission:
n=int(input())
s=str(input())
ans=0
i=0
while i<1000:
  temp=i//100
  cnt=0
  k=0
  for j in range(0,n):
    if temp==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==0:
    i=i+100
  else:
    temp=(i-(i//100)*100)//10
    for j in range(k+1,n):      
      if temp==int(s[j]):
        cnt=cnt+1
        k=j
        break
    if cnt==1:
      i=i+10
    else:
      temp=i%10
      i=i+1
      for j in range(k+1,n):
        if temp==int(s[j]):
          ans=ans+1
          break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=str(input())
ans=[]
for i in range(0,n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      ans.append(s[i]+s[j]+s[k])
ans=list(set(ans))
print(len(ans))

Fixed submission:
n=int(input())
s=str(input())
ans=0
i=0
while i<1000:
  temp=i//100
  cnt=0
  k=0
  for j in range(0,n):
    if temp==int(s[j]):
      cnt=cnt+1
      k=j
      break
  if cnt==0:
    i=i+100
  else:
    temp=(i-(i//100)*100)//10
    for j in range(k+1,n):      
      if temp==int(s[j]):
        cnt=cnt+1
        k=j
        break
    if cnt==1:
      i=i+10
    else:
      temp=i%10
      i=i+1
      for j in range(k+1,n):
        if temp==int(s[j]):
          ans=ans+1
          break
print(ans)