Harryxun/stf_run huggingface dataset:
n,*l=open(0);n=int(n);l=list(map(int,l))
p=[0]*n;d=[0]*n
for i in range(n):p[i]=l[i]+p[i-2];d[i]=max(p[i-1]if(i&1)else d[i-1],l[i]+d[i-2])
print(d[-1])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
if n<=3:print(max(a));exit()
if n&1:
  dp=[3*[-(10**20)]for _ in range(n)]
  dp[0][0]=a[0]
  for i in range(1,n):
    if i%2==0:
      dp[i][0]=dp[i-2][0]+a[i]
      if i>=3:dp[i][2]=max(dp[i-2][2]+a[i],dp[i-3][1]+a[i])
      else:dp[i][2]=a[i]
    else:
      if i>=3:dp[i][1]=max(dp[i-2][1]+a[i],dp[i-3][0]+a[i])
      else:dp[i][1]=a[i]
  print(max(dp[-1][2],dp[-2][1],dp[-3][0]))
else:
  b=[a[0]]
  c=[a[1]]
  for i in range(2,n):
    if i%2==0:b.append(b[-1]+a[i])
    else:c.append(c[-1]+a[i])
  ans=max(b[-1],c[-1])
  for i in range(n//2-1):
    ans=max(ans,b[i]+c[-1]-c[i])
  print(ans)
N ,K = map(int, input().split())
ans=0
for i in range(N):
  h=int(input())
  if h>=K:
    ans+=1
print(ans)
    


### FIXED CODE ###

N ,K = map(int, input().split())
ans=0
h=list(map(int, input().split()))
for i in range(N):
  if h[i]>=K:
    ans+=1
print(ans)
from collections import defaultdict
tmp = [defaultdict(int) for i in range(n)]
n = int(input())
s = [input() for i in range(n)]

for j in range(len(s)):
    for k in s[j]:
        tmp[j][k] += 1
        
ans = 0
for i in range(0,len(s)):
    for j in range(i+1,len(s)):
        if(tmp[i]==tmp[j]):
            print(s[i])
            print(s[j])
            ans += 1
print(ans)

### FIXED CODE ###

from collections import defaultdict
dic = defaultdict(int)

n = int(input())
s = [input() for i in range(n)]

ans = 0
for j in range(len(s)):
    mozi = sorted(s[j])
    mozi_s = "".join(mozi)
    ans += dic[mozi_s]
    dic[mozi_s] += 1
    
print(ans)
text = input()
if text ==  'a'
    print(vowel)
elif text ==  i 
    print(vowel)
elif text ==  u 
    print(vowel)
elif text ==  e 
    print(vowel)
elif text == o 
    print=(vowel)
else:
    print=(consonant)

### FIXED CODE ###

s=input()
if s == "a" or s == "i" or s == "u" or s =="e" or s == "o":
    print("vowel")
else:
    print("consonant")
import math
S = imput()
print(S*2*math.pi)

### FIXED CODE ###

S = int(input())
print(S*2*3.14)
k = int(input())
x, y = [int(x) for x in input().strip().split(" ")]
x, y = x-y, x+y

def main():
    if k % 2 == 0:
        if x % 2 != 0:
            return -1
    return to(x,y)

def cc(x, xs):
        if abs(x-xs) <= 2*k:
            if abs(x+k-xs) % 2 == k % 2:
                if abs(x+k-xs) <= abs(x-k-xs):
                    xs = x+k
                else:
                    xs = x-k
                return (True,xs)
            else:
                if x > xs:
                    xs += k
                else:
                    xs -= k
        else:
            if x > xs:
                xs += k
            else:
                xs -= k
        return (False,xs)


def to(x, y):
    rs = []
    xs, ys = 0, 0
    while True:
        if abs(x-xs) == k or abs(y-ys) == k:
            if abs(x-xs) <= k and abs(y-ys) <= k:
                return rs + [(x, y)]
        mm, ys = cc(y, ys)
        if mm:
            if x > xs:
                xs += k
            else:
                xs -= k
        else:
            mm, xs = cc(x, xs)
        rs.append((xs, ys))

if __name__ == '__main__':
    jj = main()
    if jj == -1:
        print(-1)
    else:
        print(len(jj))
        for r in jj:
            print((r[0]+r[1])//2, (r[1]-r[0])//2)




### FIXED CODE ###

a, b = map(int, input().split())
if a%2 == b%2:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")
import sys
from collections import deque
input = sys.stdin.readline
N, u, v = [int(x) for x in input().strip().split()]

m = [[] for n in range(N)]
f_aokikun = [False for n in range(N)]
f_takahashikun = [False for n in range(N)]
aokikun = [0 for n in range(N)]
takahashikun = [0 for n in range(N)]
takahashikun_enable = [1 for n in range(N)]
for n in range(N-1):
    a, b = [int(x) for x in input().strip().split()]
    m[a-1].append(b)
    m[b-1].append(a)

def aokifunc(c, f, p, cost):
    c[p-1] = cost
    f[p-1] = True
    for p_next in m[p-1]:
        if f[p_next-1]:
            continue
        aokifunc(c, f, p_next, cost+1)

def takahashifunc(c, f, p, cost, aokikun, takahashikun_enable):
    if aokikun[p-1] <= cost:
        takahashikun_enable[p-1] = 0
    c[p-1] = 0
    f[p-1] = True
    for p_next in m[p-1]:
        if f[p_next-1]:
            continue
        takahashifunc(c, f, p_next, cost+1, aokikun, takahashikun_enable)

aokifunc(aokikun, f_aokikun, v, 0)
takahashifunc(takahashikun, f_takahashikun, u, 0, aokikun, takahashikun_enable)
print(max([i * j for i, j in zip(aokikun, takahashikun_enable)])-1)

### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(10 ** 5)
input = sys.stdin.readline
N, u, v = [int(x) for x in input().strip().split()]

m = [[] for n in range(N)]
f_aokikun = [False for n in range(N)]
f_takahashikun = [False for n in range(N)]
aokikun = [0 for n in range(N)]
takahashikun = [0 for n in range(N)]
takahashikun_enable = [1 for n in range(N)]
for n in range(N-1):
    a, b = [int(x) for x in input().strip().split()]
    m[a-1].append(b)
    m[b-1].append(a)

def aokifunc(c, f, p, cost):
    c[p-1] = cost
    f[p-1] = True
    for p_next in m[p-1]:
        if f[p_next-1]:
            continue
        aokifunc(c, f, p_next, cost+1)

def takahashifunc(c, f, p, cost, aokikun, takahashikun_enable):
    if aokikun[p-1] <= cost:
        takahashikun_enable[p-1] = 0
    c[p-1] = 0
    f[p-1] = True
    for p_next in m[p-1]:
        if f[p_next-1]:
            continue
        takahashifunc(c, f, p_next, cost+1, aokikun, takahashikun_enable)

aokifunc(aokikun, f_aokikun, v, 0)
takahashifunc(takahashikun, f_takahashikun, u, 0, aokikun, takahashikun_enable)
print(max([i * j for i, j in zip(aokikun, takahashikun_enable)])-1)
S = input()
Q = int(input())
flag = False
for _ in range(Q):
    T = input()
  
    if len(T)==1:
        flag = not flag
    else:
      	S = S[::-1]
        if T[2]=="1":
            S = T[4]+S
        else:
              S = S+T[4]
print(S)

### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())

t = deque(S)
reverse = False
for _ in range(Q):
    query = input()
    if query[0] == '1':
        reverse = not reverse
    elif query[0] == '2':
        _, F, C = query.split()
        if F == '1':
            if reverse:
                t.append(C)
            else:
                t.appendleft(C)
        elif F == '2':
            if reverse:
                t.appendleft(C)
            else:
                t.append(C)
result = ''.join(t)
if reverse:
    result = result[::-1]
print(result)
data = input(split())
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(A * B)
else:
  print('-1')

### FIXED CODE ###

data = input().split()
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(str(A * B))
else:
  print('-1')
import copy

N, K = map(int, input().split())
V = [int(i) for i in input().split()]

value = 0
# k+1個取って，ret-1個戻す
num = min(N,K)
for k in reversed(range(num)):
    for ret in range(K-k): 
        if (ret < k+1):
            for i in range(k+1+1): # 左右の分け方
                tmp = []
                V_tmp = copy.copy(V)
                tmp.extend(V_tmp[:i]) # 左端
                V_tmp = V_tmp[i:]
                if (k+1-i) > 0:
                    tmp.extend(V_tmp[-(k+1-i):]) #右端
                if V_tmp == []:
                    break
                tmp = list(filter(lambda x: x not in sorted(tmp)[:ret],tmp))
                value = max(value,sum(tmp))
print(value)

### FIXED CODE ###

inp = input()
A = int(inp.split()[0])
P = int(inp.split()[1])
result = int((A*3+P)/2)
print(result)
from operator import itemgetter

N = int(input())


A = []
for i in range(N - 1):
    A.append([int(i) for i in input().split()])

B = []
for row in A:
    B.append(sorted(row))
B.sort(key = itemgetter(0))

link_list = [[] for i in range(N)]
for row in B:
    link_list[row[0] - 1].append(row[1] - 1)
    link_list[row[1] - 1].append(row[0] - 1)
edge_color = dict()
marker = [0] * N


def DFS_color(node, pre_color):
    target_list = link_list[node]
    color = 1
    for ko_node in target_list:
        if marker[ko_node] == 0:
            if pre_color == color:
                color += 1
            edge_color[node, ko_node] = color
            edge_color[ko_node, node] = color 
            marker[ko_node] = 1
            DFS_color(ko_node, color)
            color += 1
        else:
            pass

marker[0] = 1
DFS_color(0, 0)
"""
print(max(edge_color.values()))
for node1, node2 in A:
    print(edge_color[node1 - 1, node2 - 1])
"""

### FIXED CODE ###

from operator import itemgetter
import sys
sys.setrecursionlimit(10**7)

N = int(input())


A = []
for i in range(N - 1):
    A.append([int(i)-1 for i in input().split()])

B = []
for row in A:
    B.append(sorted(row))
B.sort(key = itemgetter(0))

link_list = [[] for i in range(N)]
for row in B:
    link_list[row[0]].append(row[1])
    link_list[row[1]].append(row[0])
edge_color = dict()
marker = [0] * N


def DFS_color(node, pre_color):
    target_list = link_list[node]
    color = 1
    for ko_node in target_list:
        if marker[ko_node] == 0:
            if pre_color == color:
                color += 1
            edge_color[node, ko_node] = color
            edge_color[ko_node, node] = color 
            marker[ko_node] = 1
            DFS_color(ko_node, color)
            color += 1
        else:
            pass

marker[0] = 1
DFS_color(0, 0)

print(max(edge_color.values()))
for node1, node2 in A:
    print(edge_color[node1, node2])
from collections import Counter
import math

def div(n):
    if n == 1:
        return []
    prime = []
    tmp = int(math.sqrt(n)) + 1
    
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            prime.append(num)
    
    if len(prime) == 0:
        return [1]
    else:
        return prime

n = int(input())
prime_div = dict(Counter(div(n)))
ans = 0
divs = list(prime_div.values())

for i in range(len(divs)):
    k = 0
    for j in range(1, 10):
        k += j
        if k > divs[i]:
            tmp = divs[i] - k + j
            break
        ans += 1

theta = 0
for i in range(1, 10):
    theta += i 
    if theta >= tmp:
        break
    ans += 1

print(ans)

### FIXED CODE ###

from collections import Counter
import math

def div(n):
    prime = []
    tmp = int(math.sqrt(n)) + 1
    
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            prime.append(num)
    
    if n != 1:
        prime.append(n)
    return prime

n = int(input())
prime_div = Counter(div(n))
ans = 0

for p, ex in prime_div.items():
    k = 1
    while ex >= k:
        ex -= k
        ans += 1
        k += 1

print(ans)
n = int(input())
s = input()

max_n = 0

for i in range(1,n):
    x = set()
    y = set()
    for j in range(0,i):
        x.add(s[j])
    for j in range(i,n):
        y.add(s[j])

    if len(x|y) > max_n:
        max_n = len(x|y)

print(max_n)



### FIXED CODE ###

a, b = map(int, input().split())

k = b - a - 1

a_i = 0
for i in range(1, b - a):
    a_i += i

print(a_i - a)
n, m = map(int, input().split())
ship = []
for i in range(m):
    a, b = map(int, input().split())
    if a == 1 or b == n:
        ship.append((a, b))

ship.sort()
print(ship)
i = 0

while ship[i][0] == 1:
    i += 1

for j in range(i):
    for k in range(i, len(ship)):
        if ship[j][1] == ship[k][0]:
            print("POSSIBLE")
            exit()

print("IMPOSSIBLE")


### FIXED CODE ###

n, m = map(int, input().split())
ship_1 = [False]*(n+1)
ship_n = [False]*(n+1)
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        ship_1[b] = True
    elif b == n:
        ship_n[a] = True

for i in range(len(ship_1)):
    if ship_1[i] and ship_n[i]:
        print("POSSIBLE")
        exit()

print("IMPOSSIBLE")
import math
from functools import reduce

n = int(input())
aList = list(map(int, input().split()))

def gcd(numbers):
    return reduce(math.gcd, numbers)

ans = 0
if n == 2:
    ans = max(aList)
else:
    for i in range(0,n):
        tmp = aList.pop(0)
        r = gcd(aList)
        if ans < r:
            ans = r
        aList.append(tmp)

print(ans)

### FIXED CODE ###

import fractions

n = int(input())
aList = list(map(int, input().split()))

def gcd3(nums):
    ans1 = fractions.gcd(nums[0], nums[1])
    ans2 = fractions.gcd(nums[0], nums[2])
    ans3 = fractions.gcd(nums[1], nums[2])

    if ans1 >= ans2 and ans1 >= ans3:
        return ans1, nums[2]
    if ans2 >= ans1 and ans2 >= ans3:
        return ans2, nums[1]
    if ans3 >= ans1 and ans3 >= ans2:
        return ans3, nums[0]

ans = 0
if n == 2:
    ans = max(aList)
else:
    sList = []
    sList.append(aList.pop(0))
    sList.append(aList.pop(0))
    sList.append(aList.pop(0))
    ans, v = gcd3(sList)

    for i in range(len(aList)):
        tmp = aList.pop(0)
        tmp1 = fractions.gcd(ans, v)
        tmp2 = fractions.gcd(ans, tmp)
        if tmp1 >= tmp2:
            ans = tmp1
            v = tmp
        else:
            ans = tmp2

print(ans)
while True:
    pair_num = input("A pair of numbers")
    if pair_num == '':
        break
    a, b = pair_num.split(" ")
    print(int(a) + int(b))


### FIXED CODE ###

import sys
for line in sys.stdin:
    if line == None or line == '/n':
        break
    a,b = line.split(" ")
    print( int(a) + int(b) )
n = input()
a = list(map(int, input().split()))
cnt=0
while all(i%2==0 for i in a):
    a = [i/2 for in a]
    cnt += 1
    
print(cnt)

### FIXED CODE ###

n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)
import numpy as np
ans=10**9
a=np.array([0,0,0])
b=np.array([0,0,0])
c=np.array([0,0,0])
s=[]
t=[]
N,C=map(int,input().split())
for i in range(C):
    s.append(list(map(int,input().split())))
for i in range(N):
    t.append(list(map(int,input().split())))
for j in range(N):
    for i in range(N):
        if (i+j)%3==0:
            a+=np.array(s[t[i][j]-1])
        elif (i+j)%3==1:
            b+=np.array(s[t[i][j]-1])
        else:
            c+=np.array(s[t[i][j]-1])
from itertools import permutations
for i,j,k in permutations(range(C),3):
    p=a[i]+b[j]+c[k]
    ans=min(p,ans)
print(ans)    
            
    

### FIXED CODE ###

import numpy as np
N,C=map(int,input().split())
ans=10**9
a=np.array([0]*C)
b=np.array([0]*C)
c=np.array([0]*C)
s=[]
t=[]
for i in range(C):
    s.append(list(map(int,input().split())))
for i in range(N):
    t.append(list(map(int,input().split())))
for j in range(N):
    for i in range(N):
        if (i+j)%3==0:
            a+=np.array(s[t[i][j]-1])
        elif (i+j)%3==1:
            b+=np.array(s[t[i][j]-1])
        else:
            c+=np.array(s[t[i][j]-1])
from itertools import permutations
for i,j,k in permutations(range(C),3):
    p=a[i]+b[j]+c[k]
    ans=min(p,ans)
print(ans)
#encoding=utf-8

import statistics as st
word1 = []
word = raw_input().split()
print st.mode(word)
for i in xrange(len(word)):
	word1.append(len(word[i]))
for i in xrange(len(word)):
	if len(word[i]) == max(word1):
		print word[i]

### FIXED CODE ###

s = raw_input().split()
maxLength, maxCount = 0, 0
word1, word2, count = "", "", {}
for i in range(len(s)):
	count[s[i]] = 0
for i in range(len(s)):
	count[s[i]] += 1
	if(len(s[i]) > maxLength):
		maxLength = len(s[i])
		word2 = s[i]
for i in range(len(s)):
	if(count[s[i]] > maxCount):
		maxCount = count[s[i]]
		word1 = s[i]
print word1, word2
# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())
x = list(map(int, input()))
x.sorted()
o = 0
for i in range(b):
    o = O+x[i]
print(o)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
o = 0
for i in range(b):
    o = o+x[i]
print(o)
import sys
from itertools import combinations

import numpy as np

n = int(input())
points = np.array([np.fromiter(map(int, line.split()), dtype=np.float64) for line in sys.stdin])

if n == 2:
    p1, p2 = points
    print(np.sqrt(((p1 - p2) ** 2).sum()) / 2)
    exit()

ans = 10 ** 18
for p1, p2, p3 in combinations(points, 3):
    A = ((p2 - p3) ** 2).sum()
    B = ((p3 - p1) ** 2).sum()
    C = ((p1 - p2) ** 2).sum()
    sa, sb, sc = sorted([A, B, C])
    if sa + sb <= sc:
        c = (p2 + p3 if A == sc else p1 + p3 if B == sc else p1 + p2) / 2
        R2 = sc / 4
    else:
        T = A * (B + C - A)
        U = B * (C + A - B)
        W = C * (A + B - C)
        c = (T * p1 + U * p2 + W * p3) / (T + U + W)
        R2 = ((c - p1) ** 2).sum()
    if ((points - c) ** 2).sum(axis=1).max() <= R2:
        print(np.sqrt(R2))
        break
else:
    raise AssertionError


### FIXED CODE ###

import sys
from itertools import combinations

import numpy as np

n = int(input())
points = np.array([np.fromiter(map(int, line.split()), dtype=np.float64) for line in sys.stdin])

if n == 2:
    p1, p2 = points
    print(np.sqrt(((p1 - p2) ** 2).sum()) / 2)
    exit()

ans = 10 ** 18
for p1, p2, p3 in combinations(points, 3):
    A = ((p2 - p3) ** 2).sum()
    B = ((p3 - p1) ** 2).sum()
    C = ((p1 - p2) ** 2).sum()
    sa, sb, sc = sorted([A, B, C])
    if sa + sb <= sc + 1e-7:
        c = (p2 + p3 if A == sc else p1 + p3 if B == sc else p1 + p2) / 2
        R2 = sc / 4
    else:
        T = A * (B + C - A)
        U = B * (C + A - B)
        W = C * (A + B - C)
        c = (T * p1 + U * p2 + W * p3) / (T + U + W)
        R2 = ((c - p1) ** 2).sum()
    if ((points - c) ** 2).sum(axis=1).max() <= R2 + 1e-7:
        print(np.sqrt(R2))
        break
else:
    raise AssertionError
def main():
    N = int(input())
    A = input()
    Q = input()

    answer = sum(list(map(int, A.split())))
    A = A.replace(" ", "")

    operateList = (open(0).read().split("\n"))[:-1]

    for operate in operateList:
        B, C = operate.split()
        numB = A.count(B)

        answer = answer + (int(C) - int(B)) * numB
        print(answer)

        A = A.replace(B, C)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())

    answer = sum(A)
    setA = set(A)
    numNumberList = [0] * 100001

    for Ai in A:
        numNumberList[Ai] = numNumberList[Ai] + 1    

    for i in range(Q):
        B, C = list(map(int, sys.stdin.readline().split()))
        answer = answer + (int(C) - int(B)) * numNumberList[B]

        numNumberList[C] = numNumberList[C] + numNumberList[B]
        numNumberList[B] = 0

        print(answer)

if __name__ == "__main__":
    main()
n, s = int(input()), input()
dp = [0] * (n + 1)
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        if s[i] == s[j]:
            dp[j + 1] = min(dp[j] + 1, j - i)
        else:
          dp[j + 1] = 0
    ans = max(ans, dp)
print(ans)


### FIXED CODE ###

n, s = int(input()), input()
dp = [[0] * (n + 1) for i in range(n + 1)]
for i in range(n):
    for j in range(i + 1, n):
        if s[i] == s[j]:
            dp[i + 1][j + 1] = min(dp[i][j] + 1, j - i)
from itertools import chain
print(max(i for i in chain.from_iterable(dp)))
A,B,C = list(map(int,input().split()))
if A * C > B:
    print(int(B / A))
else:
    print((C)

### FIXED CODE ###

A,B,C = list(map(int,input().split()))
if A * C > B:
    print(int(B / A))
else:
    print(C)
from collections import defaultdict as dd

N, M = map(int, input().split())
MOD = 10 ** 9 + 7
# a1 x a2 x .. x aN = M となる数列{ai}が何通りあるか
# まずは素因数分解
def make_prime_dict(x):
    primes = dd(int)
    check = 2
    while True:
        if x % check == 0:
            primes[check] += 1
            x = x // check
        else:
            check += 1
            if check > x:
                break
    return dict(primes)

primes = make_prime_dict(M)

fact = [1]
fact_inv = [1]
Q = max(primes.values())
for i in range(1, Q + N):
    fact.append(fact[-1] * i % MOD)
    fact_inv.append(fact_inv[-1] * pow(i, MOD - 2, MOD))

def mod_comb(n, r, mod):
    return fact[n] * fact_inv[n - r] % mod * fact_inv[r] % mod

res = 1
for q in primes.values():
    res *= mod_comb(q + N - 1, q, MOD) % MOD

print(res)

### FIXED CODE ###

from collections import defaultdict as dd

N, M = map(int, input().split())
MOD = 10 ** 9 + 7
# a1 x a2 x .. x aN = M となる数列{ai}が何通りあるか
# まずは素因数分解
def make_prime_dict(x):
    primes = dd(int)
    check = 2
    while True:
        if x % check == 0:
            primes[check] += 1
            x = x // check
        else:
            check += 1
            if check > x:
                break
    return dict(primes)

primes = make_prime_dict(M)
if len(primes) == 0:
    print(1)
    exit()
Q = max(primes.values())
fact = [1]
fact_inv = [1]
for i in range(Q+N):
    new_fact = fact[-1] * (i+1) % MOD
    fact.append(new_fact)
    fact_inv.append(pow(new_fact, MOD - 2, MOD))

def mod_comb(n, r, mod):
    return fact[n] * fact_inv[n - r] % mod * fact_inv[r] % mod

res = 1
for q in primes.values():
    res *= mod_comb(q + N - 1, q, MOD)
    res %= MOD

print(res)
A=int(input())
B=int(input())
 
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)

### FIXED CODE ###

i = list(map(int, input().split()))
 #出力：['s_1', 's_2']
A=i[0] #出力：s_1
B=i[1] #出力：s_2

if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)
#import math
#import bisect
#import numpy as np
#import itertools
import sys
input = sys.stdin.readline
MOD = 10**9 + 7
INF = float('INF')
sys.setrecursionlimit(10**5)

def main():
    n = int(input())
    s = input()
    ans = 0
    pin = list(itertools.product(range(10), repeat=3))

    for cur in pin:
        a, b, c = map(str,cur)
        if a in s:
            aidx = s.index(a)
            if b in s[aidx+1:]:
                bidx = s[aidx+1:].index(b) + (aidx + 1)
                if c in s[bidx+1:]:
                    ans += 1

    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

#import math
#import bisect
#import numpy as np
import itertools
import sys
input = sys.stdin.readline
MOD = 10**9 + 7
INF = float('INF')
sys.setrecursionlimit(10**5)

def main():
    n = int(input())
    s = input()
    ans = 0
    pin = list(itertools.product(range(10), repeat=3))

    for cur in pin:
        a, b, c = map(str,cur)
        if a in s:
            aidx = s.index(a)
            if b in s[aidx+1:]:
                bidx = s[aidx+1:].index(b) + (aidx + 1)
                if c in s[bidx+1:]:
                    ans += 1

    print(ans)


if __name__ == '__main__':
    main()
from collections import Counter
c = Counter(input())
if c.most_commons(1)[0][1] >= 3:
  print('YES')
else:
  print('NO')
  

### FIXED CODE ###

s = input().rstrip()
if all((s[0] == i for i in s[:-1])) or all((s[1] == i for i in s[1:])):
  print('Yes')
else:
  print('No')
from collections import Counter


N = int(input())
A = list(map(int, input().split()))

nc = Counter(A)
C = []
for i in range(1, max(A)):
    c = nc[i - 1] + nc[i] + nc[i + 1]
    C.append(c)

print(max(C))

### FIXED CODE ###

from collections import Counter


N = int(input())
A = list(map(int, input().split()))

nc = Counter(A)
C = []
for i in range(max(A) + 1):
    c = nc[i - 1] + nc[i] + nc[i + 1]
    C.append(c)

print(max(C))