Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N = input()
A = list(map(int,input().split()))
count = 0
exist_odd = False

while (exist_odd == False):
  for x in A:
    x = int(x)
    if x % 2 != 0:
      exist_odd = True
      
  if exist_odd == True:
    break
  else:
    for x in A:
      x /= 2
      count += 1
print(count)
        

### FIXED CODE ###

N = input()
A = list(map(int,input().split()))
count = 0
exist_odd = False

while (exist_odd == False):
  for x in A:
    if x % 2 != 0:
      exist_odd = True
      
  if exist_odd == True:
    break
  else:
    A = [x/2 for x in A]
  count += 1
print(count)
### BUGGY CODE ###

def main():
    S = input()
    p = 2019
    d = {i:0 for i in range(p)}
    d[0] = 1
    r = 0
    x = 0
    for i in range(len(S)):
        x += int(S[len(S)-1-i]) * pow(10, i)
        x %= p
        r += d[x]
        d[x] += 1
    return r
print(main())


### FIXED CODE ###

def main():
    S = input()
    p = 2019
    d = {i:0 for i in range(p)}
    d[0] = 1
    r = 0
    x = 0
    for i in range(len(S)):
        x += int(S[len(S)-1-i]) * pow(10, i, p)
        x %= p
        r += d[x]
        d[x] += 1
    return r
print(main())
### BUGGY CODE ###

import time,sys
start=time.time()
while time.time()-start<=4.978:pass
for input in sys.stdin:print(sum(map(int,input.split())))

### FIXED CODE ###

import time,sys
s=time.time()
while time.time()-s<=4.9775:pass
for i in sys.stdin:print(sum(map(int,i.split())))
### BUGGY CODE ###

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

ans = 10**10
s = sum(a_li)

for i in range(1,n):
    
    tmp = abs(s - 2*sum(a_li[i:]))
    ans = min(ans,tmp)
    
print(ans)

### FIXED CODE ###

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

ans = 10**10
s = sum(a_li)
tmp = 0

for i in range(n):
    tmp += a_li[i]
    res = abs(s - 2*tmp)
    ans = min(ans,res)
    
print(ans)
### BUGGY CODE ###

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    H,W,K = map(int, readline().split())
    S = [readline().strip() for j in range(H)]

    white = []
    for line in S:
        white.append(line.count("1"))
    white_total = sum(white)

    if white_total <= K:
        print(0)
        exit()

    # 横線の決め方を全探索
    ans = 10**5
    for pattern in range(2**(H-1)):
        # 初期化
        impossible = False
        x = 0
        ly = bin(pattern).count("1")
        y = [[0]*W]*(ly + 1)
        line = 0
        for i in range(H):
            y[line] = [y[line][j] + int(S[i][j]) for j in range(W)]
            if (pattern >> i) & 1:
                line += 1

        # 各列の値を加算していく
        count = [0]*(ly + 1) 
        for col in zip(*y):
            # Kより大きい値を加算する場合は不成立
            if any(a > K for a in col):
                impossible = True
                break
            for i, a in enumerate(col):
                count[i] += a
                # 和がKより大きければカット数を増やす
                if count[i] > K:
                    x += 1
                    count = list(col) 
                    break
        if impossible:
            x = 10**6

        ans = min(ans, x + ly)

    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    H,W,K = map(int, readline().split())
    S = [readline().strip() for j in range(H)]

    white = []
    for line in S:
        white.append(line.count("1"))
    white_total = sum(white)

    if white_total <= K:
        print(0)
        exit()

    ans = 10**5
    for i in range(2**(H-1)):
        impossible = False
        x = 0
        ly = bin(i).count("1")
        y_sum = [0]*(ly + 1)
        j = 0
        while j < W:
            m = 0
            y = [0]*(ly + 1)
            for k in range(H):
                if S[k][j] == "1":
                    y[m] += 1
                    if y[m] > K:
                        impossible = True
                        break
                    y_sum[m] += 1
                    if y_sum[m] > K:
                        x += 1
                        y_sum = [0]*(ly + 1)
                        j -= 1
                        break
                if (i >> k) & 1:
                    m += 1
            j += 1
            if impossible:
                x = 10**6
                break

        ans = min(ans, x + ly)

    print(ans)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

n, m = map(int, input().split())
a = []
for _ in range(m):
  a_ = int(input())
  a.append(a_)

dp = [0] * (n+1)
if 1 not in a:
  dp[1] = 1
if 2 not in a and n != 1:
  dp[2] = dp[1] + 1
for i in range(3, n+1):
  if i not in a:
    dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%(10**9+7))

### FIXED CODE ###

n, m = map(int, input().split())
a = set()
for _ in range(m):
  a_ = int(input())
  a.add(a_)

dp = [0] * (n+1)
if 1 not in a:
  dp[1] = 1
if 2 not in a and n != 1:
  dp[2] = dp[1] + 1
for i in range(3, n+1):
  if i not in a:
    dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%(10**9+7))
### BUGGY CODE ###

import numpy as np

n = int(input())
x = [tuple(map(int, input().split())) for _ in range(n)]

def circle(x, y, z):

    ra = np.array(x)
    rb = np.array(y)
    rc = np.array(z)

    A = np.dot(rb-rc,rb-rc)
    B = np.dot(rc-ra,rc-ra)
    C = np.dot(ra-rb,ra-rb)

    T = A*(B+C-A)
    U = B*(C+A-B)
    W = C*(A+B-C)

    rcc = (T*ra + U*rb + W*rc)/(T + U + W)

    return rcc

def dis(a, b, c, d):
    return (a - b)**2 + (c - d)**2

e = 10 ** (-9)
ans = 10 ** 18
for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            a = x[i]
            b = x[j]
            c = x[k]
            px, py = circle(a, b, c)
            r = dis(px, a[0], py, a[1])
            ok = True
            for s, t in x:
                if dis(px, s, py, t) > r + e:
                    ok = False
                    break
            if ok:
                ans = min(ans, r)
for i in range(n):
    for j in range(i+1, n):
        a = x[i]
        b = x[j]
        px, py = (a[0]+b[0])/2, (a[1]+b[1])/2
        r = dis(px, a[0], py, a[1])
        ok = True
        for s, t in x:
            if dis(px, s, py, t) > r + e:
                ok = False
                break
        if ok:
            ans = min(ans, r)

print(ans ** (1/2))

### FIXED CODE ###

import numpy as np

n = int(input())
x = [tuple(map(int, input().split())) for _ in range(n)]

def circle(x, y, z):

    ra = np.array(x)
    rb = np.array(y)
    rc = np.array(z)

    A = np.dot(rb-rc,rb-rc)
    B = np.dot(rc-ra,rc-ra)
    C = np.dot(ra-rb,ra-rb)

    T = A*(B+C-A)
    U = B*(C+A-B)
    W = C*(A+B-C)

    rcc = (T*ra + U*rb + W*rc)/(T + U + W)

    return rcc

def dis(a, b, c, d):
    return (a - b)**2 + (c - d)**2

e = 10 ** (-9)
ans = 10 ** 18
for i in range(n):
    for j in range(i+1, n):
        a = x[i]
        b = x[j]
        px, py = (a[0]+b[0])/2, (a[1]+b[1])/2
        r = dis(px, a[0], py, a[1])
        ok = True
        for s, t in x:
            if dis(px, s, py, t) > r + e:
                ok = False
                break
        if ok:
            ans = min(ans, r)

if ans != 10 ** 18:
    print(ans ** (1/2))
    exit()

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            a = x[i]
            b = x[j]
            c = x[k]
            px, py = circle(a, b, c)
            r = dis(px, a[0], py, a[1])
            ok = True
            for s, t in x:
                if dis(px, s, py, t) > r + e:
                    ok = False
                    break
            if ok:
                ans = min(ans, r)

print(ans ** (1/2))
### BUGGY CODE ###

import re
s=input()
m=0
for i in range(len(s)//2):
  dst = re.sub(r'01|10', "", s)
  dst = re.sub(r'00000000000000000000001111111111111111111111|11111111111111111111110000000000000000000000', "", dst)
  if dst == s:
    break
  m += len(s) - len(dst)
  s=dst
print(m)

### FIXED CODE ###

s=input();print(min(s.count("0"), s.count("1"))*2)
### BUGGY CODE ###

from sys import stdin
input = stdin.readline
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
c = Counter(a)
s = set()
ans = 0
for i in sorted(set(a)):
    j=i*2
    while j<=1000000:
        s.add(j)
        j+=i
    if i not in s and c[i]==1:
        ans+=1
            
print(ans)

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int,input().split()))
c = Counter(a)
s = set()
ans = 0
for i in sorted(set(a)):
    j=i*2
    while j<=1000000:
        s.add(j)
        j+=i
    if i not in s and c[i]==1:
        ans+=1
            
print(ans)
### BUGGY CODE ###

import sys,collections,math,random,fractions,bisect;sys.setrecursionlimit(10**7)
sr = sys.stdin.readline;
def I(i=0): t = [int(x)-i for x in sr().split()];return t
def S(): t = sr().split(); return t if len(t) > 1 else t[0]
L1,L2,L3,L4, = [],[],[],[]
 
N,D,A = I()
for i in range(N):
    X,H = I()
    L1.append([X,math.ceil(H/A)])
L2 = sorted(L1)
ans = 0
for i in range(N):
    if L2[i][1] > 0:
        ans += L2[i][1]
        lim = L2[i][0] + 2*D
        for j in range(1,N-i):
            if L2[i+j][0] <= lim:
                L2[i+j][1] -= L2[i][1]
            else:
                break
        L2[i][1] -= L2[i][1]
print(ans)

### FIXED CODE ###

import sys,math
sr = sys.stdin.readline
def I(i=0):return [int(x)-i for x in sr().split()]
L1,L2 = [],[]

N,D,A = I()
for i in range(N):
    X,H = I()
    L1.append([X,math.ceil(H/A)])
L1 = sorted(L1)
j = 1
L2 = [-1]*N
for i in range(N):
    lim = L1[i][0] + 2*D
    for k in range(j,N):
        if L1[k][0] > lim:
            L2[i] = k-1
            j = k-1
            break
        elif k == N-1:
            L2[i] = N-1
            j = N-1
ans = 0
a,s = 0,0
for i in range(N):
    x,h = L1[i]
    h -= a
    if h > 0:
        ans += h
        a += h
        L1[i][1] = h
    else:
        L1[i][1] = 0
    while s < N and L2[s] <= i:
        a -= L1[s][1]
        s += 1
print(ans)
### BUGGY CODE ###

import math
N = int(input())
A = list(map(int, input().split()))
ans1 = "pairwise coprime"
ans2 = "setwise coprime"
ans3 = "not coprime"

def func(number):
    factor = []
    div = 2
    s = math.sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor.append(div)
        div += 1
    if number > 1:
        factor.append(number)
        
    return set(factor)

a = math.gcd(A[0], A[1])
for i in range(2, N):
    a = math.gcd(a, A[i])

if a==1:
    b = True
    l = func(A[0])
    for i in range(1, N):
        
        if l&func(A[i])==set():
            l=l|func(A[i])
        else:
            b=False
            break
    if b:
        print(ans1)
    else:
        print(ans2)
        
        
    
else:
    print(ans3)



### FIXED CODE ###

import math
N = int(input())
A = list(map(int, input().split()))
ans1 = "pairwise coprime"
ans2 = "setwise coprime"
ans3 = "not coprime"

a = math.gcd(A[0], A[1])
for i in range(2, N):
    a = math.gcd(a, A[i])

if a==1:
    b = True
    l = [0]*(10**6+1)
    x = [0]*(10**6+1)
    x[0]=1
    x[1]=1
    for i in range(2, 10**6+1):
        if x[i]==0:
            for j in range(i, 10**6+1, i):
                x[j]=i

    for y in A:
        s=set()
        if y==1:
            continue
        elif y==x[y]:
            s |= {y}        #素因数のリスト
        else:
            while y!=x[y]: #素数になるまで
                s|={x[y]}  
                y//=x[y]
                if y==x[y]:
                    s|={x[y]}
                    break
        for i in s:
            l[i]+=1
            if l[i]>=2:
                b=False
                break
                
        
    if b:
        print(ans1)
    else:
        print(ans2)
        
        
    
else:
    print(ans3)
### BUGGY CODE ###

N = int(input())
num_lis = list(map(int, input().split()))
ans = 0
p = 10**9+7
for i in range(N-1):
  ans += (num_lis[i]*sum(num_lis[i+1:N]))%p

print(ans%p)

### FIXED CODE ###

N = int(input())
num_lis = list(map(int, input().split()))
ans = 0
p = 10**9+7
s = sum(num_lis)
num = 0
for i in range(N):
  num += num_lis[i]
  ans += ((s-num)*num_lis[i])%p
  
print(ans%p)
### BUGGY CODE ###

#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

N,Q = II()
a = [0]*(N-1)
b = [0]*(N-1)
p = [0]*Q
x = [0]*Q

for i in range(N-1):
    a1,b1 = II()
    a[i] = a1-1
    b[i] = b1-1

for i in range(Q):
    p1,x1 = II()
    p[i] = p1-1
    x[i] = x1


def bfs(pt,v):
    n=len(pt)
    d=[-1]*n
    d[v]=0
    q=[v]
    c=1
    while q:
        q1=[]
        for i in q:
            for j in pt[i]:
                if d[j]==-1:
                    d[j]=c
                    q1.append(j)
        q=q1
        c+=1
    return d


pt = defaultdict(list)
for i in range(N-1):
    pt[a[i]].append(b[i])
    pt[b[i]].append(a[i])
d = bfs(pt,0)

parent = defaultdict(list)
for i in range(N-1):
    if d[a[i]]>d[b[i]]:
        parent[a[i]].append(b[i])
    else:
        parent[b[i]].append(a[i])

val = [0]*N
for i in range(Q):
    val[p[i]] += x[i]

for i in range(N):
    now = i
    ans = 0
    while now != 0:
        ans += val[now]
        now = parent[now][0]
    print(val[0]+ans)

### FIXED CODE ###

#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

N,Q = II()
a = [0]*(N-1)
b = [0]*(N-1)
p = [0]*Q
x = [0]*Q

for i in range(N-1):
    a1,b1 = II()
    a[i] = a1-1
    b[i] = b1-1

for i in range(Q):
    p1,x1 = II()
    p[i] = p1-1
    x[i] = x1


parent = defaultdict(list)
for i in range(N-1):
    parent[b[i]].append(a[i])

val = [0]*N
for i in range(Q):
    val[p[i]] += x[i]

for i in range(1,N):
    val[i] += val[parent[i][0]]

print(*val)
### BUGGY CODE ###

N,Q=map(int,input().split())
S=str(input())
for i in range(Q):
    l,r=map(int,input().split())
    count=0
    for j in range(l,r):
        if S[j-1]=="A" and S[j]=="C":
            count+=1
    print(count)

### FIXED CODE ###

N, Q = map(int, input().split())
S = str(input())
wa=[0]*N
p=0
for j in range(1,N):
    if S[j-1]=="A" and S[j]=="C":
        p+=1
        wa[j]=p
    else:
        wa[j]=wa[j-1]
for i in range(Q):
    k =input().split()
    l=int(k[0])
    r=int(k[1])
    print(wa[r-1]-wa[l-1])
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n = int(input())
x = list(map(int, input().split()))
lists = []
ind = ((n-1) + 1) // 2
for i in range(n):
    if i == 0:
        ans = x[i + 1:]
        ans.sort()
        lists.append(ans[ind-1])
    else:
        ans = x[0:i] + x[i + 1:]
        ans.sort()
        lists.append(ans[ind - 1])
[print(x) for x in lists]


### FIXED CODE ###

n = int(input())
x = list(map(int,input().split()))
y = sorted(x)[n//2-1:n//2+1]
for i in x:print(y[i <= y[0]])
### BUGGY CODE ###

#!/usr/bin/env python3

def main():
    import sys
    input = sys.stdin.readline
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A_temp=[0]*N
    for k in range(min(K,41)):
        for i,data in enumerate(A):
            for j in range(max(0,i-data),min(N,i+data+1)):
                A_temp[j]+=1
        A=A_temp
        A_temp=[0]*N
    print(*A)
    
if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    
    for k in range(K):
        A_temp=[0]*(N+1)
        for i in range(N):
            A_temp[max(0,i-A[i])]+=1
            if i+A[i]+1<=N-1:
                A_temp[i+A[i]+1]-=1
            
        A[0]=A_temp[0]
        for j in range(1,N):
            A_temp[j]+=A_temp[j-1]
            A[j]=A_temp[j]
        for ai in A:
            if ai != N:
                break
        else:
            break
                
    print(' '.join([str(a) for a in A]))
    
if __name__ == "__main__":
    main()
### BUGGY CODE ###

n, q = map(int, input().split())
s = input()
l = []
r = []
ans = []
for i in range(q):
    lq, rq = map(int, input().split())
    print(s[lq-1:rq].count('AC'))

### FIXED CODE ###

N,Q=map(int,input().split())
S=input()
count=[0]*N
for i in range(1,N):
    count[i]+=count[i-1]
    if S[i-1:i+1]=="AC":count[i]+=1
for i in range(Q):
    l,r=map(int,input().split())
    print(count[r-1]-count[l-1])
### BUGGY CODE ###

import bisect

INF = 10**9 + 1

N, Q = [int(x) for x in input().split()]

data = []
for i in range(N):
    S, T, X = [int(x) for x in input().split()]
    data.append([X, S, T])
data = sorted(data, reverse=True)

D = []
for i in range(Q):
    D.append(int(input()))

dist = [INF]*Q
for i in range(N):
    [X, S, T] = data[i]
    l = bisect.bisect_left(D, S - X - 0.5)
    r = bisect.bisect_right(D, T - X - 0.5)
    dist = dist[:l] + [X]*(r - l) + dist[r:]

for i in range(Q):
    if dist[i] == INF:
        print(-1)
    else:
        print(dist[i])

### FIXED CODE ###

import sys
input=sys.stdin.readline
from bisect import bisect_left
n,q=map(int,input().split())
stop=[]
for i in range(n):
	s,t,x=map(int,input().split())
	stop.append((s,t,x))
stop.sort(key=lambda x:x[2])
d=[int(input())for i in range(q)]
R=[-1]*q
ans=[-1]*q
for s,t,x in stop:
	#lからrにある区間のansをxに更新したい
	l=bisect_left(d,s-x)
	r=bisect_left(d,t-x)
	while l<r:
		if R[l]==-1:#最左がまだ確定していない場合
			ans[l]=x
			R[l]=r
			l+=1
		else:
			l=R[l]#確定しているところを飛ばす
for x in ans:
	print(x)
### BUGGY CODE ###

N = int(input())

arr = [0 for _ in range(N+1)]
def DFS(x,y,z):
    n = (x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)
    if n <= N:
        if x == y and y == z:
            arr[n] += 1
        elif (x == y) or (y == z) or (z == x):
            arr[n] += 3
        else:
            arr[n] += 6
        if x+1<=y:
            DFS(x+1,y,z)
        if y+1<=z:
            DFS(x,y+1,z)
        DFS(x,y,z+1)
    return(0)

DFS(1,1,1)
for i in arr[1:]:
    print(i)


### FIXED CODE ###

N = int(input())

arr = [0 for _ in range(N+1)]
for x in range(1,N+1):
    F1 = True
    for y in range(x,N+1):
        F2 = True
        for z in range(y,N+1):
            n = (x**2)+(y**2)+(z**2)+(x*y)+(y*z)+(z*x)
            if n > N:
                if y == z:
                    F2 = False
                break
            else:
                if x == y and y == z:
                    arr[n] += 1
                elif (x == y) or (y == z) or (z == x):
                    arr[n] += 3
                else:
                    arr[n] += 6
        if F2 == False:
            if x == y:
                F1 = False
            break
    if F1 == False:
        break

for i in arr[1:]:
    print(i)
### BUGGY CODE ###

#!/usr/bin/python

import math
import sys

def is_prime(n):
    if n == 1:
        return False

    for i in xrange(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            return False
    return True

def main(argv):
    primes = [False]
    for i in xrange(1, 100000 + 1):
        primes.append(is_prime(i))

    results = [0]
    for i in xrange(1, 100000 + 1):
        if i % 2 == 0:
            results.append(0)
            continue

        if primes[i] and primes[(i + 1) / 2]:
            results.append(1)
        else:
            results.append(0)

    line = sys.stdin.readline()
    while line:
        Q = int(line.rstrip("\n"))
        for i in xrange(Q):
            l, r = map(
              lambda i: int(i), sys.stdin.readline().rstrip("\n").split(" "))

            print sum(results[l:r+1])

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)

### FIXED CODE ###

#!/usr/bin/python

import math
import sys

def is_prime(n):
    if n == 1:
        return False

    for i in xrange(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            return False
    return True

def main(argv):
    primes = [False]
    for i in xrange(1, 100000 + 1):
        primes.append(is_prime(i))

    counter = 0
    results = [0]
    for i in xrange(1, 100000 + 1):
        if i % 2 == 0:
            results.append(counter)
            continue

        if primes[i] and primes[(i + 1) / 2]:
            counter += 1
        results.append(counter)

    line = sys.stdin.readline()
    while line:
        Q = int(line.rstrip("\n"))
        for i in xrange(Q):
            l, r = map(
              lambda i: int(i), sys.stdin.readline().rstrip("\n").split(" "))

            print results[r] - results[l - 1]

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)
### BUGGY CODE ###

import itertools

if __name__ == '__main__':

	n,m = map(int,input().split())

	A =[]
	for i in range(n):
		A.append(list(map(int,input().split())))

	maxval = 0
	for v in itertools.combinations(A,m):
		a = abs(sum(list(map(lambda x: x[0], v))))
		b = abs(sum(list(map(lambda x: x[1], v))))
		c = abs(sum(list(map(lambda x: x[2], v))))

		maxval = max(maxval,a+b+c)

	print(maxval)


### FIXED CODE ###

import itertools

if __name__ == '__main__':

	n,m = map(int,input().split())

	A =[]
	for i in range(n):
		A.append(list(map(int,input().split())))

	P = list(itertools.product([1,-1],repeat=3))

	maxval = 0

	for p in P:
		B=[]
		for a in A:
			val = (a[0] * p[0]) + (a[1] * p[1]) + (a[2] * p[2])
			B.append(val)

		#結果をソートして上位ｍ番目までの合計を計算する	
		C = sorted(B,reverse=True)
		maxval = max(maxval,sum(C[:m]))

	print(maxval)
### BUGGY CODE ###

N=int(input())
S=input()

pin={}
for i in range(10):
  for j in range(10):
    for k in range(10):
      pin['{}{}{}'.format(i,j,k)]=0

l=len(S)
for i in range(l):
  for j in range(i+1,l):
    for k in range(j+1,l):
      s=S[i]+S[j]+S[k]
      pin[s]=1


ans=0
for i in pin:
  if pin[i]==1:
    ans+=1

print(ans)

### FIXED CODE ###

N=int(input())
S=input()
S=list(map(int,S))
ans=0
for s in range(1000):
      A=s//100
      B=(s-A*100)//10
      C=s-A*100-B*10
      isOne=0
      isTen=0
      isHundred=0
      for i in range(N) :
        if isOne==0:
          if S[i]==A: 
            isOne=1
        elif isTen==0:
          if S[i]==B: 
            isTen=1
        elif isHundred==0:
          if S[i]==C:
            isHundred=1
            ans+=1
        else:
          break

print(ans)
### BUGGY CODE ###

N, K = map(int, input().split())

A = list(map(int, input().split()))
AA = []
for i in range(2):
    AA.extend(A)

x = 0
for i in range(N):
    for j in range(N-1, i, -1):
        if A[j] < A[j-1]:
            A[j], A[j-1] = A[j-1], A[j]
            x += 1
M = 10**9 + 7

y = 0
NN = N*2
for i in range(NN):
    for j in range(NN-1, i, -1):
        if AA[j] < AA[j-1]:
            AA[j], AA[j-1] = AA[j-1], AA[j]
            y += 1

a = (K*x)
b = (y - 2*x) * (K*(K-1)//2)
ans = ((a+b)  % M)
print(int(ans))

### FIXED CODE ###

N, K = map(int, input().split())

A = list(map(int, input().split()))
AA = []
for i in range(2):
    AA.extend(A)

x = 0
for i in range(N):
    for j in range(i+1, N):
        if A[j] < A[i]:
            x += 1
M = 10**9 + 7

y = 0
NN = N*2
for i in range(NN):
    for j in range(i+1, NN):
        if AA[j] < AA[i]:
            y += 1

a = (K*x)
b = (y - 2*x) * (K*(K-1)//2)
ans = ((a+b)  % M)
print(int(ans))
### BUGGY CODE ###

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

for i in range(n - 1):
    print(a.index(i + 1) + 1, end = ' ')
print(a.index(n) + 1)

### FIXED CODE ###

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

order = [0] * n

for i in range(n):
    order[a[i] - 1] = i + 1

print(' '.join(map(str, order)))