Harryxun/stf_run huggingface dataset:
a = list(map(int,input().split()))
search = [-1 for i in range(n)]
l,r = -1,-1
for i,x in enumerate(a):
    if search[x-1] == -1:
        search[x-1] = i
    else:
        l = search[x-1]
        r = i
#print(l,r)
p = 10**9 + 7

#前計算
comb1 = [0 for _ in range(n+1)]
comb1[0] = n+1
x = n+1
for i in range(1,n+1):
    x = (x*(n-i+1))%p
    x = (x*pow(i+1,p-2,p))%p
    comb1[i] = x

comb2 = [0 for _ in range(n+1)]
comb2[0] = 1
x = 1
for i in range(1,l+n-r+1):
    x = (x*(n+l-r-i+1))%p
    x = (x*pow(i,p-2,p))%p
    comb2[i] = x

for i in range(n+1):
    ans = comb1[i]-comb2[i]

    print(ans%p)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
search = [-1 for i in range(n)]
l,r = -1,-1
for i,x in enumerate(a):
    if search[x-1] == -1:
        search[x-1] = i
    else:
        l = search[x-1]
        r = i
#print(l,r)
p = 10**9 + 7

#前計算
comb1 = [0 for _ in range(n+1)]
comb1[0] = n+1
x = n+1
for i in range(1,n+1):
    x = (x*(n-i+1))%p
    x = (x*pow(i+1,p-2,p))%p
    comb1[i] = x

comb2 = [0 for _ in range(n+1)]
comb2[0] = 1
x = 1
for i in range(1,l+n-r+1):
    x = (x*(n+l-r-i+1))%p
    x = (x*pow(i,p-2,p))%p
    comb2[i] = x

for i in range(n+1):
    ans = comb1[i]-comb2[i]

    print(ans%p)
s = input()
t = input()
 
strings = s*len(t)

idx = -1
if set(t) <= set(s):
    for i in t:
        idx = strings.find(i, idx+1)
    print(idx+1)
else:
    print("-1")


### FIXED CODE ###

s = input()
t = input()

idx = -1
count = 0

if set(t) <= set(s):
    for i in t:
        idx = s.find(i, idx+1)
        if idx == -1:
            idx = s.find(i)
            count += 1
    pdc = count * len(s)
    total_idx = (idx + 1) + pdc 
    print(total_idx)
else:
    print(-1)
import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    N, K = read_values()
    A = read_list()
    A.sort(reverse=True)
    if A[0] < 0:
        res = 1
        for a in A[:K]:
            res *= a
            res %= mod
        print(res)
        return

    A.sort(key=lambda a: abs(a), reverse=True)
    res = 1
    c = 0
    p = -1
    n = 1
    for a in A[:K]:
        if a < 0:
            c += 1
            n = a
        else:
            p = a
        res *= a
        res %= mod
    
    if c % 2 == 1:
        p1, n1 = None, None
        for a in A[K:]:
            if a >= 0 and p1 is None:
                p1 = a
            if a < 0 and p2 is None:
                n1 = a
        if p1 is None:
            res *= n1
            res *= pow(p, mod - 2, mod)
            res %= mod
        elif n1 is None or p < 0:
            res *= p1
            res *= pow(n, mod - 2, mod)
            res %= mod
        else:
            res *= pow(p, mod - 2, mod)
            res *= pow(n, mod - 2, mod)
            res %= mod
            t = min(p * n1, n * p1)
            res *= t
            res %= mod
    print(res)
            

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
import random
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


N, K = read_values()
def main():
    A = read_list()
    # A = [random.randint(-10 ** 9, 10 ** 9) for _ in range(N)]

    A.sort(reverse=True)
    if N == K or (A[0] < 0 and K % 2 == 1):
        res = 1
        for a in A[:K]:
            res *= a
            res %= mod
        print(res)
        return

    A.sort(key=lambda a: abs(a), reverse=True)

    P1 = list(filter(lambda a: a >= 0, A[:K]))
    P2 = list(filter(lambda a: a >= 0, A[K:]))
    N1 = list(filter(lambda a: a < 0, A[:K]))
    N2 = list(filter(lambda a: a < 0, A[K:]))

    if len(N1) % 2 == 1:
        # if N1[-1] * N2[0] : P1[-1] * P2[0]
        if len(P1) == 0 or len(N2) == 0:
            N1[-1] = P2[0]
        elif len(P2) == 0:
            P1[-1] = N2[0]
        else:
            if P1[-1] * P2[0] >= N1[-1] * N2[0]:
                N1[-1] = P2[0]
            else:
                P1[-1] = N2[0]
    
    res = 1
    for p in P1:
        res *= p
        res %= mod

    for n in N1:
        res *= n
        res %= mod
    
    print(res % mod)
        

if __name__ == "__main__":
    main()
s = input()
res = 0
for i in range(len(s)):
    cnt = 0
    while s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        cnt += 1
        i += 1
    res = max(res,cnt)
print(res)

### FIXED CODE ###

s = input()
res = 0
for i in range(len(s)):
    cnt = 0
    while s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        cnt += 1
        i += 1
        if i==len(s):
          break
    res = max(res,cnt)
print(res)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np
N = int(readline())
S = np.empty(N+1,'S1')
S[1:] = np.frombuffer(list(readline()),dtype='S1')[:N]
Q = int(readline())
query = map(int,readline().split())

isD = S == b'D'
isM = S == b'M'
isC = S == b'C'

cumD = isD.cumsum(dtype=np.int64)
cumM = isM.cumsum(dtype=np.int64)

for K in query:
    x = cumD.copy(); x[K:] -= cumD[:-K]
    x *= isM
    x[K+1:] -= isD[1:-K] * (cumM[K:-1] - cumM[:-K-1])
    print((x.cumsum() * isC).sum())


### FIXED CODE ###

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

import numpy as np

N = int(readline())
S = np.frombuffer(readline().rstrip(),'S1')
Q = int(readline())
query = map(int,read().split())

isD = S == b'D'
isM = S == b'M'
isC = S == b'C'

cumD = isD.cumsum(dtype=np.int64)
cumM = isM.cumsum(dtype=np.int64)

def F(K):
    """
    ・Cごとに数える。
    ・そのためには(i-K,i] 内のDMの個数を調べる（負インデックスには関係ない文字があると思っておく）
    ・区間内のDの個数、Mの個数が取得できれば、差分が取得できるので最後に累積和
    """
    # (i-K,i]内のDの個数、Mの個数
    D = cumD.copy(); D[K:] -= cumD[:-K]
    M = cumM.copy(); M[K:] -= cumM[:-K]
    # 最後がMのとき、Dの個数分増える
    DM = isM * D
    # 左端のDを捨てるとき、Mの個数分減る
    DM[K:] -= isD[:-K] * M[K-1:-1]
    np.cumsum(DM,out=DM)
    # Cごとに集計
    return DM[isC].sum()

print('\n'.join(str(F(K)) for K in query))
class UnionFind:
    def __init__(self, elems):
        self.parent = dict()
        self.members = dict()
        for e in elems:
            self.parent[e] = e
            self.members[e] = 1

    def root(self, e):
        if self.parent[e] == e:
            return e

        self.parent[e] = self.root(self.parent[e])
        return self.parent[e]

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        if self.same(x, y):
            return

        self.members[self.root(y)] += self.members[self.root(x)]
        self.parent[self.root(x)] = self.root(y)

    def num_members(self, x):
        return self.members[self.root(x)]


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

bs.reverse()

uf = UnionFind(range(1, n+1))

inconv = n * (n - 1) // 2
inconvs = [inconv]
for b in bs[:-1]:
    i1, i2 = b
    if not uf.same(i1, i2):
        inconv -= uf.num_members(i1) * uf.num_members(i2)

    inconvs.append(inconv)
    uf.unite(i1, i2)

for inc in reversed(inconvs):
    print(inc)

### FIXED CODE ###

class UnionFind:
    def __init__(self, elems):
        self.parent = dict()
        self.children = dict()
        for e in elems:
            self.parent[e] = e
            self.children[e] = 1

    def root(self, e):
        if self.parent[e] == e:
            return e

        return self.root(self.parent[e])

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        if self.same(x, y):
            return

        rx, ry = self.root(x), self.root(y)
        # ry <- rx
        if self.members(ry) < self.members(rx):
            rx, ry = ry, rx

        self.children[ry] += self.children[rx]
        self.parent[rx] = ry

    def members(self, x):
        return self.children[self.root(x)]


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

bs.reverse()

uf = UnionFind(list(range(1, n+1)))

inconv = n * (n - 1) // 2
inconvs = [inconv]
for b in bs[:-1]:
    i1, i2 = b
    if not uf.same(i1, i2):
        inconv -= uf.members(i1) * uf.members(i2)

    inconvs.append(inconv)
    uf.unite(i1, i2)

for inc in reversed(inconvs):
    print(inc)
input_numbers = list(map(int,input().split()))
a = input_numbers[0]
b = input_numbers[1]
A = a
B = b
x = 0
y = 0
while A >= 0:
  x += 10 ** A * b
  A -= 1
while B >= 0:
  y += 10 ** B * a
  B -= 1
if x > y:
  ptint(x)
else:
  print(y)

### FIXED CODE ###

input_numbers = list(map(int,input().split()))
a = input_numbers[0]
b = input_numbers[1]
A = a
B = b
x = 0
y = 0
while A > 0:
  x += 10 ** (A-1) * b
  A -= 1
while B > 0:
  y += 10 ** (B-1) * a
  B -= 1
if x > y:
  print(x)
else:
  print(y)
N = int(input())
M = N[2] + N[1] + N[0]
if N == M:
	print('Yes')
else:
	print('No')

### FIXED CODE ###

N = input()
M = N[2] + N[1] + N[0]
if N == M:
	print('Yes')
else:
	print('No')
def draw(h, w):
    for i in range(h):
        for j in range(w):
            print("#" if (i+j)%2 == 0 else ".", end='')
        print("")
    print("")

while True:
    h, w = map(int, raw_input().split())
    if h == 0 and w == 0:
        break
    draw(h, w)

### FIXED CODE ###

def draw(h, w):
    for i in range(h):
        s = ""
        for j in range(w):
            s += ("#" if (i+j)%2 == 0 else ".")
        print(s)
    print("")

while True:
    h, w = map(int, raw_input().split())
    if h == 0 and w == 0:
        break
    draw(h, w)
import math
import copy
H,N=map(int,input().split())

dp=[0]+[None]*(H)

for i in range(N):
    A,B=map(int,input().split())
    ndp=copy.deepcopy(dp)
    for i in range(A,H+1):
        if dp[i]==None:
            if ndp[i-A]==None:
                ndp[i]=None
            else:
                ndp[i]=ndp[i-A]+B
        else:
            if dp[i-A]==None:
                ndp[i]=dp[i]
            else:
                ndp=min(dp[i],dp[i-A]+B)
    
    mi=B*math.ceil(H/A)
    
    for i in range(H%A+1):
        if ndp[-(i+1)]==None:
            pass
        else:
            mi=min(mi,ndp[-(i+1)]+B)
    
    if ndp[-1]==None:
        ndp[-1]=mi
    else:
        ndp[-1]=min(ndp[-1],mi)

    dp=ndp
    #print(dp)

print(dp[-1])

### FIXED CODE ###

import math

def main():
    H,N=map(int,input().split())

    inf=float('inf')
    dp=[0]+[inf]*H

    for i in range(N):
        A,B=map(int,input().split())
        if A>=H:
            #dp[-1]=min(B,dp[-1])
            if B < dp[-1]:
                dp[-1]=B
        else:
            for j in range(A,H+1):
                #dp[j]=min(dp[j-A]+B,dp[j])
                if dp[j-A]+B<dp[j]:
                    dp[j]=dp[j-A]+B

                if j > H-A:
                    #dp[-1]=min(dp[-1],dp[j]+B)
                    if dp[j]+B < dp[-1]:
                        dp[-1]=dp[j]+B

    print(dp[-1])

main()
A,B,C,X,Y = map(int,input().split())
a = 0

if A+B < C*2:
    a += (A+B) * min(X,Y)
else
    a += C*2 * min(X,Y)
if X > Y:
    a += min(A,C*2)*(X-Y)
else:
    a += min(B,C*2)*(Y-X)
print(a)

### FIXED CODE ###

A,B,C,X,Y = map(int,input().split())
a = 0

if A + B < C * 2:
    a += (A + B) * min(X, Y)
else:
    a += 2 * C * min(X, Y)

if X > Y:
    a += min(A, C * 2) * (X - Y)
else:
    a += min(B, C * 2) * (Y - X)
        
print(a)
import heapq


def small_multiple(k):
    # kの倍数で各桁の総数が最も小さくなるような、各桁の総数
    dist = [float("inf")] * k
    q = []
    # kで割った余りが1になるような最小の数は1
    heapq.heappush(q, (1, 1))
 
    while q:
        n, c = heapq.heappop(q)
        if dist[n] <= c:
            continue
        print(n, c)
        dist[n] = c
 
        if dist[(n+1) % k] > c + 1:
            heapq.heappush(q, ((n + 1) % k, c + 1))
        if dist[(n*10) % k] > c:
            heapq.heappush(q, ((n * 10) % k, c))
 
    print(dist[0])
 
 
def main():
	k = int(input())
    small_multiple(k)
 
 
if __name__ == "__main__":
    main()

### FIXED CODE ###

import heapq


def small_multiple(k):
    # kの倍数で各桁の総数が最も小さくなるような、各桁の総数
    dist = [float("inf")] * k
    q = []
    # kで割った余りが1になるような最小の数は1
    heapq.heappush(q, (1, 1))

    while q:
        n, c = heapq.heappop(q)
        if dist[n] <= c:
            continue
        dist[n] = c

        if dist[(n + 1) % k] > c + 1:
            heapq.heappush(q, ((n + 1) % k, c + 1))
        if dist[(n * 10) % k] > c:
            heapq.heappush(q, ((n * 10) % k, c))

    print(dist[0])


def main():
    k = int(input())
    small_multiple(k)


if __name__ == "__main__":
    main()
N, L = map(int, input().split())
s = [0 for i in range(N)]
for i in range(N):
    s[i] = input()

s.sort()
output = ""
for i in range(L):
    output += s[i]
print(output)


### FIXED CODE ###

N, L = map(int, input().split())
s = [0 for i in range(N)]
for i in range(N):
    s[i] = input()

s.sort()
output = ""
for i in range(N):
    output += s[i]
print(output)
A = int(input())
B = int(input())
if B >= 0:
    if (A+B)>=(A*B):
        print(A+B)
    else:
        print(A*B)
else:
    if (A-B)>=(A*B):
        print(A-B)
    else:
        print(A*B)

### FIXED CODE ###

A,B = map(int,input().split())
if B >= 0:
    if (A+B)>=(A*B):
        print(A+B)
    else:
        print(A*B)
else:
    if (A-B)>=(A*B):
        print(A-B)
    else:
        print(A*B)
N,D,A = map(int,input().split())
d = {}
E = []
for i in range(N):
    x,h = map(int,input().split())
    d[x] = h
    E.append(x)
E.sort()
ans = 0
import bisect
for i in range(N):
    x = E[i]
    if d[x] <= 0:
        continue
    y = bisect.bisect_right(E,x+2*D)
    ans += d[x]
    for j in range(i,y):
        d[j] -= d[x]
print(ans)

### FIXED CODE ###

N,D,A = map(int,input().split())
attack_number = {}
Enemy = []
import math
for i in range(N):
    x,h = map(int,input().split())
    n = math.ceil(h/A)
    attack_number[x] = n
    Enemy.append(x)
Enemy.sort()
bomb_number = [0 for i in range(N+1)]
F = {}
import bisect
for i in range(N):
    x = Enemy[i]
    y = bisect.bisect_right(Enemy,x+2*D)
    F[i] = y
ans = 0
for i in range(N):
    if i > 0:
        bomb_number[i] += bomb_number[i-1]
    x = attack_number[Enemy[i]] - bomb_number[i]
    if x <= 0:
        continue
    y = F[i]
    bomb_number[i] += x
    bomb_number[y] -= x
    ans += x
print(ans)
import sys


def solve(a, b, h):
    return (a + b) * h / 2


a = sys.stdin.readline().rstrip()
int(a)
b = sys.stdin.readline().rstrip()
int(b)
h = sys.stdin.readline().rstrip()
int(h)
ans = solve(a, b, h)
print "{0}".format(ans)

### FIXED CODE ###

def solve(a, b, h):
    return (a + b) * h / 2


a = raw_input()
a = int(a)
b = raw_input()
b = int(b)
h = raw_input()
h = int(h)
ans = solve(a, b, h)
print ans
from functools import reduce
from math import gcd

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

c=10**4+1
D=[0]*c
div=[0]*c
P=[]

for i in range(2,c):
    if D[i]==0:
        P.append(i)
        D[i]=i
    for j in P:
        if i*j>c-1  or j>D[i] :
           break
        D[i*j]=j
g=A[0]
f=0
for i in A:
    if i==1:
        continue
    temp=i
    if temp==D[temp]:
        if div[D[temp]]==1:
            f=1
            break
        div[D[temp]]+=1
        continue
    while temp!=D[temp]:
        if div[D[temp]]==1:
            f=1
            break
        div[D[temp]]+=1
        temp=temp//D[temp]
    if f==1:
        break

if f==0:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')

### FIXED CODE ###

from functools import reduce
from math import gcd

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

c=max(A)+1
D=[0]*c
div=[0]*c
P=[]

for i in range(2,c):
    if D[i]==0:
        P.append(i)
        D[i]=i
    for j in P:
        if i*j>=c  or j>D[i] :
           break
        D[i*j]=j
f=0
for i in A:
    if i==1:
        continue
    temp=i
    while temp!=1:
        if div[D[temp]]==1:
            f=1
            break
        div[D[temp]]+=1
        temp2=D[temp]
        while temp%temp2==0 and temp>=temp2:
            temp=temp//temp2
    if f==1:
        break
        


if max(div)<=1 and f==0:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')
import numpy as np
import sys
n = int(input())
h = [int(i) for i in input().split()]
if n == 1:
    print('Yes')
    sys.exit()

diff_h = np.diff(h)
diff_h[diff_h >= 0] = 0
if np.count_nonzero(diff_h) > 1:
    print('No')
elif np.min(diff_h) < -1:
    print('No')
else:
    a = diff_h.nonzero()
    a = a[0][0]
    if (h[a] == h[a-1]) and a>0:
        print('No')
    else:
        print('Yes')

### FIXED CODE ###

n = int(input())
h = [int(i) for i in input().split()]
h.reverse()
next = h[0]
import sys
for i in h[1:]:
    if i - next > 1:
        print('No')
        sys.exit()
    elif i - next == 1:
        next = i - 1
    else:
        next = i
print('Yes')
from fractions import gcd
from collections import deque
n,X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
x.append(X)
x = sorted(x)
k = x[0]
x = deque([i-k for i in x])
x.popleft()

def gcdn():
    if len(x)==1:
        return
    p=x.pop()
    q=x.pop()
    x.append(gcd(p,q))
    gcdn()

gcdn()
print(x[0])

### FIXED CODE ###

import sys
sys.setrecursionlimit((2**31)-1)
from fractions import gcd
from collections import deque
n,X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
x.append(X)
x = sorted(x)
k = x[0]
x = deque([i-k for i in x])
x.popleft()

def gcdn():
    if len(x)==1:
        return
    p=x.pop()
    q=x.pop()
    x.append(gcd(p,q))
    gcdn()

gcdn()
print(x[0])
def main():
    s = input()
    t = input()
    dp = [[0] * len(s) for _ in range(len(t))]
    for i,x in enumerate(s):
        for j,y in enumerate(t):
            if i == 0:
                dp[i][j] = 1 if x in t[:j+1] else 0
            elif j == 0:
                dp[i][j] = 1 if y in s[:i+1] else 0
            elif x == y:
                dp[i][j] = dp[i-1][j-1] + 1
            else:
                dp[i][j] = max(dp[i-1][j], dp[i][j-1])
    print(dp[len(s)-1][len(t)-1])

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    s = input()
    t = input()
    dp = [[0] * (len(t)+1) for _ in range(len(s)+1)]
    for i,x in enumerate(s):
        for j,y in enumerate(t):
            if x == y:
                dp[i+1][j+1] = dp[i][j] + 1
            else:
                dp[i+1][j+1] =  max(dp[i][j+1], dp[i+1][j])

    ans = ''
    i,j = len(s),len(t)
    while (i>0  and j>0):
        if dp[i][j] == dp[i-1][j]:
            i -= 1
        elif dp[i][j] == dp[i][j-1]:
            j -= 1
        else:
            ans += s[i-1]
            i -= 1
            j -= 1
    print(ans[::-1])

if __name__ == '__main__':
    main()
count = 1

While True:
    X = it(input())
    if x != 0:
        print("case {0}: {1}:.format(count, x)")
        count +=1
    

     else:
         break

### FIXED CODE ###

import sys
 
c = 0
while True:
    i = int(sys.stdin.readline())
    if (i == 0):
        break
    c+=1
    print("Case " + str(c) + ":", i)
import math
n=int(input())
l=[int(input()) for in range(5)]
print(mat.ceil(n/min(l))+4)


### FIXED CODE ###

import math
n=int(input())
l=[int(input()) for i in range(5)]
print(math.ceil(n/min(l))+4)
import numpy as np

k, n = map(int, input().split())
a = list(map(int, input().split()))
a.append(k)
b = []
for k in range(len(a)):
  b.append(a[k+1] - a[k])
print(k - argmax(b))

### FIXED CODE ###

k, n = map(int, input().split())
a = list(map(int, input().split()))
b = []
for l in range(len(a)-1):
  b.append(a[l+1] - a[l])
b.append(k-a[n-1]+a[0])
print(k - max(b))
N=int(input())
H=list(map(int,input().split()))
if N==1:
    print(1)
else:
    maxh=H[0]
    c=1
    for i in range(1,N):
        if maxh<=H[i]:
            c+=1
            maxh=H[i]
    print(c)

### FIXED CODE ###

A,B=map(int,input().split())
A1=2*A-1
B1=2*B-1
if A==B:
    print(2*A)
else:
    print(max(A,B)*2-1)
K = int(input())

r = 1
N = 0
while True:
    N += 7*(10**(r-1))
    if N%K ==0:
        break
    r += 1

print(r)

### FIXED CODE ###

N,D = map(int,input().split())
X=[]
Y=[]
count = 0
for i in range(N):
    a,b = map(float,input().split())
    X.append(a)
    Y.append(b)
for i in range(N):
    if (X[i]**2+Y[i]**2)**(1/2) <= D:
        count += 1

print(count)
N=int(input())
a=map(int,input().split())

ans=0
for i in range(N):
    if i%2!=0 and a[i]%2!=0:
        ans+=1
        
print(ans)

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
 
ans=0
for i in range(0,N,2):
    if a[i]%2!=0:
        ans+=1
        
print(ans)
def soinsu(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n=int(input())
a=soinsu(n)
c=[]
if n>=2:
    for i in range(max(a)):
        c.append(0)
for i in a:
    c[i-1]+=1
z=0
f=max(c)
g=[1]
d=1
e=1
while e<=f:
    d+=1
    e=d*(d+1)/2
    g.append(e)
l=len(g)
g=tuple(g)
for i in c:
    for j in range(l):
        if i<g[j]:
            z+=j
            break
        
print(z)

### FIXED CODE ###

n=int(input())
import math
s=round(math.sqrt(n))+1

i=2
c1=0
c2=1
ans=0
while i<=s:
    if n%i==0:
        n//=i
        c1+=1
        if c1==c2:
            c1=0
            c2+=1
            ans+=1
    else:
        c2=1
        i+=1
        c1=0
if n>s:
    ans+=1
    
print(ans)
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, A, B, C, D = LI()
    A -= 1
    B -= 1
    C -= 1
    D -= 1
    S = SS()

    ## 移動経路に2連続以上の岩があったらダメ
    if '##' in S[A:C+1] or '##' in S[B:D+1]:
        print('No')
    else:
        ## ふぬけ君を先に移動させればいい
        if C < D:
            print('Yes')
        ## ふぬけ君を飛び越えられる瞬間が存在すればいい
        else:
            # 岩の間のどこかに3以上の隙間があること
            if '...' in S[B:D+1]:
                print('Yes')
            else:
                print('No')

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    s = SS()
    K = I()

    l = [[] for _ in range(26)]
    for i in range(len(s)):
        l[ord(s[i])-ord('a')].append(i)

    for i in l:
        tmp = set()
        for j in i:
            for k in range(5):
                if j + k <= len(s) - 1:
                    tmp.add(s[j:j+k+1])
        tmp = list(tmp)
        tmp.sort()
        if len(tmp) >= K:
            print(tmp[K-1])
            break
        else:
            K -= len(tmp)

if __name__ == '__main__':
    resolve()
n = input()
S = map(int,raw_input().split())
m = input()
T = map(int,raw_input().split())
print len(S&T)

### FIXED CODE ###

n = input()
S = set([int(s) for s in raw_input().split()])
m = input()
T = set([int(s) for s in raw_input().split()])
print len(S&T)