Harryxun/stf_run huggingface dataset:
# E - Yutori
from typing import List


def find_workdays(
    total_days: int, workdays_length: int, days_off_length: int, schedule: List[bool]
) -> List[int]:
    if days_off_length == 0:
        workdays = [i for i, can_work in enumerate(schedule, 1) if can_work]
        return workdays if len(workdays) <= workdays_length else []

    workdays_left, workdays_right = [], []

    for workdays, gen in [
        (workdays_left, enumerate(schedule, 1)),
        (workdays_right, ((total_days - i, x) for i, x in enumerate(schedule[::-1]))),
    ]:
        days_off = 0
        for i, can_work in gen:
            if days_off:
                days_off -= 1
                continue
            if can_work:
                workdays.append(i)
                days_off = days_off_length
                if len(workdays) == workdays_length:
                    break

    return [l for l, r in zip(workdays_left, workdays_right[::-1]) if l == r]


def main():
    N, K, C = map(int, input().split())
    S = input().rstrip()
    workdays = find_workdays(N, K, C, [s == "o" for s in S])
    print("\n".join(map(str, workdays)))


if __name__ == "__main__":
    main()


### FIXED CODE ###

# E - Yutori


def find_workdays(
    total_days: int, workdays_length: int, days_off_length: int, schedule: list
) -> list:
    if days_off_length == 0:
        workdays = [i for i, can_work in enumerate(schedule, 1) if can_work]
        return workdays if len(workdays) <= workdays_length else []

    workdays_left, workdays_right = set(), set()

    cur_days_off = 0
    for i, can_work in enumerate(schedule, 1):
        if cur_days_off:
            cur_days_off -= 1
            continue
        if can_work:
            workdays_left.add(i)
            cur_days_off = days_off_length
            if len(workdays_left) == workdays_length:
                break

    cur_days_off = 0
    for i, can_work in enumerate(schedule[::-1]):
        if cur_days_off:
            cur_days_off -= 1
            continue
        if can_work:
            workdays_right.add(total_days - i)
            cur_days_off = days_off_length
            if len(workdays_right) == workdays_length:
                break

    return sorted(workdays_left & workdays_right)


def main():
    N, K, C = map(int, input().split())
    S = input().rstrip()
    workdays = find_workdays(N, K, C, [s == "o" for s in S])
    print("\n".join(map(str, workdays)))


if __name__ == "__main__":
    main()
a = int(input())
print(a.count(0))

### FIXED CODE ###

a = input()
print(a.count("1"))
N,M,X=map(int,input().split())
listA=list(map(int,input().split()))
for i in range(M-1):
  if listA[i]<X<listA[i+1]:
    ans=min(i+1,M-i-1)
  elif listA[i]==0:
    ans=min(i,M-i-1)
print(ans)

### FIXED CODE ###

N,M,X=map(int,input().split())
listA=list(map(int,input().split()))
for i in range(M-1):
  if listA[i]<X<listA[i+1]:
    ans=min(i+1,M-i-1)
  elif listA[i]==0:
    ans=min(i,M-i-1)
if X<listA[0] or listA[M-1]<X:
  ans=0
print(ans)
S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S:
    print(S-1, T)
else:
    print(S, T-1)


### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S:
    print(A-1, B)
else:
    print(A, B-1)
N = int(input())
 
ans = 0
 
for i in range(1,N+1):
    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)

### FIXED CODE ###

A, B, C = map(int, input().split())

aa = C - (A - B)

if aa > 0:
  print(aa)
else:
  print(0)
N = int(input())
S = str(input())
ans=0
for i in range(1:N-1):
    X = S[:i]
    Y = S[i:]
    Z = set(X) & set(Y)
    if len(Z) > ans :
        ans = len(Z)
print(ans)

### FIXED CODE ###

N = int(input())
S = str(input())
ans=0
for i in range(N):
    X = S[:i]
    Y = S[i:]
    Z = set(X) & set(Y)
    if len(Z) > ans :
        ans = len(Z)
print(ans)
l = int(input())
print(f"{pow(l / 3.0, 3):.10f}")


### FIXED CODE ###

l = int(input())
print(l**3 / 27)
n=input()

c=0
flag=0
for i in range(n):
  a,b = map(int,input().split())
  if(a==b):
    c+=1
  else:
    c=0
  if(c==3):
    print("Yes")
    flag=1
    break
if(flag==0):
  print("No")

### FIXED CODE ###

n=int(input())

c=0
flag=0
for i in range(n):
  a,b = map(int,input().split())
  if(a==b):
    c+=1
  else:
    c=0
  if(c==3):
    print("Yes")
    flag=1
    break
if(flag==0):
  print("No")
print('Yes' if '9' in 9list(input(())) else 'No')

### FIXED CODE ###

print('Yes' if '9' in list(input()) else 'No')
asdf={"Sunny":0,"Cloudy":1,"Rainy":2}
a=asdf[input()]
a+=1
if a>2:
  a=0
print([k for k, v in d.items() if v == a][0])

### FIXED CODE ###

asdf={"Sunny":0,"Cloudy":1,"Rainy":2}
a=asdf[input()]
a+=1
if a>2:
  a=0
print([k for k, v in asdf.items() if v == a][0])
a=int(input())
b=0
for i in range(1,a+1):
  if len(i)%2==1:
    b+=1
print(b)

### FIXED CODE ###

a=int(input())
b=0
for i in range(1,a+1):
  if len(str(i))%2==1:
    b+=1
print(b)
base = [1,2,3]
for i in range(2):
    del base[int(input())-1]
print(base[0])

### FIXED CODE ###

a = int(input())
b = int(input())
print(6-a-b)
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

n = ri()
print(n(n+1)/2)

### FIXED CODE ###

def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

n = ri()
print(n*(n+1)//2)
def resolve():
    from scipy.sparse.csgraph import shortest_path
    from scipy.sparse import csr_matrix
    import numpy as np
    n, m = map(int, input().split())
    edge = np.array([input().split() for _ in range(m)], dtype=np.int64).T
    a = csr_matrix(([1] * m, (edge - 1)))
    s, p = shortest_path(a, method='D', return_predecessors=True,
                         indices=0, directed=False, unweighted=True)
    if min(p[1:]) < -1:
        print("No")
    else:
        print("Yes")
        for i in p[1:]:
            print(i + 1)


if __name__ == '__main__':
    resolve()

### FIXED CODE ###

def resolve():
    def Dijkstra(s, n, edge, inf=float("inf")):
        import heapq
        d = [inf] * n
        used = [False] * n
        d[s] = 0
        used[s] = True
        queue = []
        path = [-9999] * n
        for e in edge[s]:
            heapq.heappush(queue, e + [s])
        while len(queue):
            dist, point, before = heapq.heappop(queue)
            if used[point]:
                continue
            d[point] = dist
            used[point] = True
            path[point] = before
            for nextdist, nextp in edge[point]:
                if not used[nextp]:
                    heapq.heappush(queue, [dist + nextdist, nextp, point])
        return d, path
    n, m = map(int, input().split())
    inf = 10 ** 10
    edge = [[] for _ in range(n)]
    for _ in range(m):
        x, y = [int(x) - 1 for x in input().split()]
        edge[x].append([1, y])
        edge[y].append([1, x])
    l, p = Dijkstra(0, n, edge, inf)
    if min(p[1:]) < -1:
        print("No")
    else:
        print("Yes")
        for i in p[1:]:
            print(i + 1)


if __name__ == '__main__':
    resolve()
n=inupt()
if n==n[::-1]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=input()
if n==n[::-1]:
  print("Yes")
else:
  print("No")
n=int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if x+Y>t or (x+y+t)%2==1:
      print("NO")
      exit()
print("YES")


### FIXED CODE ###

import sys
N=int(input())
for i in range(N):
  t,x,y=map(int,input().split())
  if (x+y)%2==t%2 and x+y<=t:
    pass
  else:
    print('No')
    sys.exit()
print('Yes')
w = input()

import collections

c = collections.Counter(w)

b = True
for i in c.values:
  if i % 2 == 1:
    b = False

print("Yes" if b else "No")

### FIXED CODE ###

w = input()

import collections

c = collections.Counter(w)

b = True
for i in c.values():
  if i % 2 == 1:
    b = False

print("Yes" if b else "No")
import itertools
a=map(int,input().split())
ans=999
l=[0,1,2]
for x in itertools(l,3):
  tmp=abs(a[x[0]]-a[x[1]])+abs(a[x[1]]-a[x[2]])
  if tmp <=ans:
    ans =tmp
print(ans)

### FIXED CODE ###

import itertools
a=list(map(int,input().split()))
ans=999
l=[0,1,2]
for x in itertools.permutations(l,3):
  tmp=abs(a[x[0]]-a[x[1]])+abs(a[x[1]]-a[x[2]])
  if tmp <=ans:
    ans =tmp
print(ans)
from collections import deque
import itertools
import numpy as np

R, C = map(int, input().split())
sy, sx = 1, 1
gy, gx = R, C

field = [["#"] * (C + 2)] + \
        [list("#" + input() + "#") for i in range(R)] + \
        [["#"] * (C + 2)]
dxy = [(0,1), (0,-1), (1,0), (-1,0)]
flg = False
cnt = 0

field_1d = list(itertools.chain.from_iterable(field))
field01 = [1 if i == '.' else 0 for i in field_1d]
dot_num = np.array(field01).sum()

q = deque()
q.append([sy, sx])
field[sy][sx] = 0

while flg == False:
    yx = q.popleft()
    cnt = field[yx[0]][yx[1]]
    for dy, dx in dxy:
        y_n, x_n = yx[0] + dy, yx[1] + dx
        if y_n == gy and x_n == gx:
            field[y_n][x_n] = cnt + 1
            flg = True
            print(dot_num - (cnt+2))
            break
        if field[y_n][x_n] == '#':
            continue
        if field[y_n][x_n] == '.':
            q.append([y_n, x_n])
            field[y_n][x_n] = cnt + 1
    if flg:
        break
if flg == False:
    print(-1)

### FIXED CODE ###

from collections import deque
 
 
def dfs(field):
    q = deque([(0, 0, 0)])
    visited = [[False] * w for _ in range(h)]
    while q:
        i, j, d = q.popleft()
        if i == h - 1 and j == w - 1:
            return d
        if visited[i][j]:
            continue
        visited[i][j] = True
        if i > 0 and field[i - 1][j] == '.':
            q.append((i - 1, j, d + 1))
        if i < h - 1 and field[i + 1][j] == '.':
            q.append((i + 1, j, d + 1))
        if j > 0 and field[i][j - 1] == '.':
            q.append((i, j - 1, d + 1))
        if j < w - 1 and field[i][j + 1] == '.':
            q.append((i, j + 1, d + 1))
    else:
        return -1
 
 
h, w = map(int, input().split())
field = [input() for _ in range(h)]
dot_cnt = sum(r.count('.') for r in field)
d = dfs(field)
if d == -1:
    print(-1)
else:
    print(dot_cnt - (d+1))
import numpy

N, M, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]

A_time = []
B_time = []

if sum(A) + sum(B) <= K:
    print(len(A) + len(B))
elif K < min(A) and K < min(B):
    print(0)
else:
    #A_res = list(numpy.cumsum(A))
    #B_res = list(numpy.cumsum(B))

    books = []

    for i in range(len(A)):
        A_sum = sum(A[0:i+1])
        if A_sum > K:
            break
        res = K - A_sum

        for j in range(M+1, 0, -1):
            B_sum = sum(B[0:j])
            if B_sum in B:
                books.append(i + j + 1)
                break
    print(max(books))


### FIXED CODE ###

n,m,k = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
 
a,b = [0],[0]
for i in range(n):
    a.append(a[i] + A[i])
for i in range(m):
    b.append(b[i] + B[i])
 
ans,j = 0,m
for i in range(n+1):
    if a[i] > k:
        break
    while b[j] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
a=input().split("¥n")
    goal=int(a[1])
    keta=len(a[0])
    for i in range(keta):
        if(int(a[0][i])==1):
            goal-=1
            if(goal<0):
                print("1")
                break
        else:
            print(a[0][i])
            break

### FIXED CODE ###

S=input()
S_len=len(S)
K=int(input())
for i in range(S_len):
  if(int(S[i])==1):
    K-=1
    if(K<=0):
      print("1")
      break
  else:
    print(S[i])
    break
print((int(input()+int(input())*int(input()//2)

### FIXED CODE ###

print((int(input())+int(input()))*int(input())//2)
n = int(input())
s = input()

from collections import Counter
rgb = dict(Counter(s))
if len(rgb) < 3:
    print('0')
else:
    p = rgb['R'] * rgb['G'] * rgb['B']
    for i in range(1, (len(s)-1)//2 + 1):
        for j in range(len(s) - 2*i):
            if {s[j], s[j + i], s[j + 2*i]} == {'R', 'G', 'B'}:
                p -= 1
    print(p)

### FIXED CODE ###

n = input()
for i in range(3):
    if n[i] == '7':
        print('Yes')
        break
else:
    print('No')
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**5)

n=int(input())
l=[list(map(int,input().split())) for _ in [0]*(n-1)]
q,k=map(int,input().split())
L=[list(map(int,input().split())) for _ in [0]*q]

neighbor=[[] for _ in range(n+1)]
for i in range(n-1):
    neighbor[l[i][0]].append([l[i][1],l[i][2]])
    neighbor[l[i][1]].append([l[i][0],l[i][2]])

cost=[-1]*(n+1)
cost[k]=0
c=0

def sol(i,p,d):
    global cost
    cost[i]=d
    for x in neighbor[i]:
        if x[0]!=p:
            sol(x[0],i,d+x[1])
sol(k,-1,0)

for i in range(q):
    print(cost[L[i][0]]+cost[L[i][1]])

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n=int(input())
l=[list(map(int,input().split())) for _ in [0]*(n-1)]
q,k=map(int,input().split())
L=[list(map(int,input().split())) for _ in [0]*q]

neighbor=[[] for _ in range(n+1)]
for i in range(n-1):
    neighbor[l[i][0]].append([l[i][1],l[i][2]])
    neighbor[l[i][1]].append([l[i][0],l[i][2]])

cost=[-1]*(n+1)
cost[k]=0
c=0

def sol(i,p,d):
    global cost
    cost[i]=d
    for x in neighbor[i]:
        if x[0]!=p:
            sol(x[0],i,d+x[1])
sol(k,-1,0)

for i in range(q):
    print(cost[L[i][0]]+cost[L[i][1]])
def main(n:int,lst:list)->int:
    b = True
    lst1 = []
    lst2 = []
    for e in lst:
        if b:
            lst1.append(e)
        else:
            lst2.append(e)
        b = not b
    lst1.sort()
    lst2.sort()
    c1 = [["",0],0]
    c2 = [["",0],0]
    last =lst1[0]
    a = 0
    for e in lst1:
        if last == e:
            a +=1
        else:
            if a >= c1[0][1]:
                c1[1] = c1[0][1]
                c1[0][0] = e
                c1[0][1] = a
            elif a > c1[1]:
                c1[1] = a
            last = e
            a = 1
    if a >= c1[0][1]:
        c1[1] = c1[0][1]
        c1[0][0] = e
        c1[0][1] = a
    elif a > c1[1]:
        c1[1] = a

    last =lst2[0]
    a = 0
    for e in lst2:
        if last == e:
            a +=1
        else:
            if a >= c2[0][1]:
                c2[1] = c2[0][1]
                c2[0][0] = e
                c2[0][1] = a
            elif a > c2[1]:
                c2[1] = a
            last = e
            a = 1
    if a >= c2[0][1]:
        c2[1] = c2[0][1]
        c2[0][0] = e
        c2[0][1] = a
    elif a > c2[1]:
        c2[1] = a

    if c1[0][0] == c2[0][0]:
        if c1[0][1] > c2[0][1] or(c1[0][1] == c2[0][1] and c2[1] > c1[1]):
            return n - c1[0][1] - c2[1]
        else:
            return n - c2[0][1] - c1[1]
    else:
        return n - c1[0][1] - c2[0][1]

n = int(input())
lst = input().split()
print(main(n,lst))


### FIXED CODE ###

print(input().replace("1","a").replace("9","1").replace("a","9"))
import itertools
N = int(input())
P = [int(x) for x in input().split()]
Q = [int(x) for x in input().split()]
R = [itertools.permutations(range(1,N+1))]
print(abs(r.idex(P)-r.index(Q)))

### FIXED CODE ###

from itertools import permutations
N = int(input())
P = tuple(int(x) for x in input().split())
Q = tuple(int(x) for x in input().split())
L = list(range(1,N+1))
R = list(permutations(L))
print(abs(R.index(P)-R.index(Q)))
n = int(sys.stdin.readline().rstrip("\n"))
i = 0
while True:
    if 2**i <= n:
        i += 1
    else:
        break
print(2**i)

### FIXED CODE ###

import sys
n = int(sys.stdin.readline().rstrip("\n"))
i = 0
while 2**i <= n:
    i += 1
print(2**(i-1))
N,W,H=[int(i) for i in input.split()]

nas=0

for i in range(N):
  h,w=[int(x) for x in input.split()]
  if h<=H and w<= W:
    ans+=1

print(ans)

### FIXED CODE ###

N,W,H=[int(i) for i in input().split()]

ans=0

for i in range(N):
  w,h=[int(x) for x in input().split()]
  if h>=H and w>= W:
    ans+=1

print(ans)
s = list(input())
s_ = list('abcdefghijklmnopqrstuvwxyz')

s = list(set(s))
s.sort()

for i in range(len(s)):
    if s[i] != s_[i]:
        print(s_[i])
        exit()
    elif i == len(s) - 1:
        print(s_[i+1])
        exit()
print('None')

### FIXED CODE ###

s = list(input())
s_ = list('abcdefghijklmnopqrstuvwxyz')

s = list(set(s))
s.sort()

for i in range(len(s)):
    if s[i] != s_[i]:
        print(s_[i])
        exit()
if len(s) < 26: print(s_[len(s)])
else: print('None')
N, A, B = map(int,input().split(" "))

cnt_a = cnt_b = 0

for i in range(10*100):
    if cnt_a + cnt_b + A >= N: 
        # N - cnt_a - cnt_b はみ出た分
        ans = cnt_a + N - cnt_a - cnt_b

    else:
        cnt_a += A
        cnt_b += B

print(ans)

### FIXED CODE ###

N, A, B = map(int,input().split(" "))

ans = (N//(A+B))*A + min((N%(A+B)),A)

print(ans)
import fraction
from functools import reduce

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def reduce_gcd(numbers):
    return reduce(fraction.gcd, numbers)


def main():
    N = int(input())
    A_N = list(map(int, input().rstrip().split()))
    gcd = reduce_gcd(A_N)
    factorized = factorize(gcd)
    if factorized:
        print(factorized[0][1])
    else:
        print('0')


if __name__ == '__main__':
    main()


### FIXED CODE ###

import fractions
from functools import reduce


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def reduce_gcd(numbers):
    return reduce(fractions.gcd, numbers)


def main():
    N = int(input())
    A_N = list(map(int, input().rstrip().split()))
    gcd = reduce_gcd(A_N)
    factorized = factorize(gcd)
    if factorized:
        print(factorized[0][1])
    else:
        print('0')


if __name__ == '__main__':
    main()
import sys     
N = int(input())
if N == 1:
    print(0)
    sys.exit()
# if isPrime(N)==True:
#     print(0)
fact = factorization(N)
fact_num = []
fact_num2 = []

    
for i in range(len(fact)):
    fact_num.append(fact[i][0])
    fact_num2.append(fact[i][1])

cnt=0

for j in range(1000000):
    for i in range(len(fact)):
        if N%fact_num[i]==0 and N%(fact_num[i]*(j+1))==0:
            N = N/(fact_num[i]*(j+1))
            cnt+=1

print(cnt)         
            

        

### FIXED CODE ###

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
 
    if temp!=1:
        arr.append([temp, 1])
 
    if arr==[]:
        arr.append([n, 1])
 
    return arr
 
import sys     
N = int(input())
if N == 1:
    print(0)
    sys.exit()

fact = factorization(N)
fact_num = []
fact_num2 = []
 

for i in range(len(fact)):
    fact_num.append(fact[i][0])
    fact_num2.append(fact[i][1])

cnt=0

for j in range(max(fact_num2)+1):
    for i in range(len(fact)):
        if N%fact_num[i]==0 and N%(fact_num[i]**(j+1))==0:
            N = N/(fact_num[i]**(j+1))
            cnt+=1

            if N==1:
                print(cnt)
                sys.exit()
print(cnt)
import math
N = int(input())
ans = N-1
n = math.sqrt(N)
n = int(n)+1
for i in range(1, n)
    if N%i==0:
        tmp = N//i
        ans = (tmp-1)+(i-1)

    
print(ans)
        


### FIXED CODE ###

import math
N = int(input())
ans = N-1
n = math.sqrt(N)
n = int(n)+1
for i in range(1, n):
    if N%i==0:
        tmp = N//i
        ans = (tmp-1)+(i-1)

    
print(ans)
import numpy as np
N = int(input())
P_lis = list(map(int,input().split()))
 
count = 0
for i in range(N):
  lis = P_lis[0:i+1]
  lis = lis - lis[i]
  if -1 in np.sign(lis):
    count += 1
print(count)

### FIXED CODE ###

N = int(input())
P_lis = list(map(int, input().split()))
 
dummy = 2*10**5
answer = 0
 
for p in P_lis:
  if p <= dummy:
    answer += 1
    dummy = p
print(answer)
case = input()
import numpy as np
case = np.array(case)
for i in range(len(case)):
  AC = 0
  WA = 0
  TLE = 0
  RE = 0
  others = 0
  if case[i] == "AC":
    AC += 1
    return AC
  elif case[i] == "WA":
    WA += 1
    return WA
  elif case[i] == "TLE":
    TLE += 1
    return TLE
  elif case[i] == "RE":
    RE += 1
    return RE
  else :
    others += 1
    return others
print("AC"+"x"+AC)
print("WA"+"x"+WA)
print("TLE"+"x"+TLE)
print("RE"+"x"+RE)

### FIXED CODE ###

N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
others = 0
for i in range(N):
  case = input()
  if case == "AC":
    AC += 1
      
  elif case == "WA":
    WA += 1
      
  elif case == "TLE":
    TLE += 1
      
  elif case == "RE":
    RE += 1
      
print("AC"+" x "+str(AC))
print("WA"+" x "+str(WA))
print("TLE"+" x "+str(TLE))
print("RE"+" x "+str(RE))
values = [int(input()) for i in range(int(input()))]
maxv = - 1000000
minv = values[0]

for val in enumerate(values):
    # maxv = max(maxv, val - minv)
    # minv = min(minv, val)
print(maxv)


### FIXED CODE ###

values = [int(input()) for _ in range(int(input()))]
maxv = values[1] - values[0]
minv = values[0]

for val in values[1:]:
    maxv = max(maxv, val - minv)
    minv = min(minv, val)         # 今までの最小値を保持(自分と自分を比較しない様に、最大値の評価後に計算)
print(maxv)
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]

from collections import defaultdict, deque
from sys import exit
import heapq
import math
import copy
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)

N = int(input())
A = list(map(int, input().split()))
listnum = [0] * 15
for i in A:
    listnum[i] += 1
for i in range(15):
    if listnum[i] >= 3:
        listnum[i] = (listnum[i] % 2) + 1
minus = listnum.count(2)
if minus % 2 == 0:
    print(sum(listnum) - minus)
else:
    print(sum(listnum) - minus - 1)

### FIXED CODE ###

def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)

N = getN()
nums = [int(e) for e in input().split()]
nums.sort()
checker = nums[0]
count = 1
for i in range(1,N):
    if(checker != nums[i]):
        count+=1
        checker = nums[i]
if(N - count)%2==0:
    print(count)
else:
    print(count-1)
#DSL_3-D Sliding Window - Sliding Minimum Elements
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = []
if N == 10**5 : 
    try :
        count += 1
    except NameError :
        count = 1
for i in range(N-L+1) : ans.append(min(A[i:i+L]))
for i in ans[:-1] : print(i, end=" ")
if count < 2 :
    print(ans[-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])