Harryxun/stf_run huggingface dataset:
N=int(input())
T=[0]+[int(x) for x in str(input()).split()]+[0]
V=[0]+[int(x) for x in str(input()).split()]+[0]
time=0
t=[0]
for i in T:
  time+=i
  t.append(time)
ans=0

for j in range(0,2*time):
  m2=100000000
  m1=100000000
  t1=j/2
  t2=(j+1)/2
  print(t1,t2)
  for i in range(N+2):
	a=t[i]
	b=t[i+1]
	c=V[i]
    if t1<=a:
      m1=min(m1,c+(a-t1))
    elif t1<=b:
      m1=min(m1,c)
    else:
      m1=min(m1,c+t1-b)

    if t2<=a:
      m2=min(m2,c+(a-t2))
    elif t2<=b:
      m2=min(m2,c)
    else:
      m2=min(m2,c+t2-b)
    
  ans+=0.25*(m1+m2)
print(ans)





### FIXED CODE ###

N=int(input())
T=[0]+[int(x) for x in str(input()).split()]+[0]
V=[0]+[int(x) for x in str(input()).split()]+[0]
 
time=0
t=[0]
for i in T:
  time+=i
  t.append(time)
ans=0
 
for j in range(0,2*time):
  m1=1000000000
  m2=1000000000
  t1=j/2
  t2=(j+1)/2
  for i in range(N+2):
    if t1<=t[i]:
      m1=min(m1,V[i]+(t[i]-t1))
    elif t1<=t[i+1]:
      m1=min(m1,V[i])
    else:
      m1=min(m1,V[i]+t1-t[i+1])
 
    if t2<=t[i]:
      m2=min(m2,V[i]+(t[i]-t2))
    elif t2<=t[i+1]:
      m2=min(m2,V[i])
    else:
      m2=min(m2,V[i]+t2-t[i+1])
    
  #print(1,m1,m2)
  ans+=0.25*(m1+m2)
print(ans)
if __name__ == '__main__':
    N = int(input())
    C = list(input())
    cnt = 0
    red_cnt = 0
    for c in B:
        if c == 'R':
            red_cnt += 1

    for i in range(red_cnt+1):
        if C[i] == 'W':
            for j in range(red_cnt, N):
                if C[j] == 'R':
                    C[i] = 'R'
                    C[j] = 'W'
                    cnt += 1
                    red_cnt = j+1
    print(cnt)

### FIXED CODE ###

if __name__ == '__main__':
    N = int(input())
    C = list(input())
    cnt = 0
    red_cnt = 0
    for c in C:
        if c == 'R':
            red_cnt += 1

    for i in range(red_cnt):
        if C[i] == 'W':
            for j in range(red_cnt, N):
                if C[j] == 'R':
                    C[i] = 'R'
                    C[j] = 'W'
                    cnt += 1
                    red_cnt = j+1
    print(cnt)
# -*- coding: utf-8 -*-


a=input()
b=input()

s=2*b-a

print(s)



### FIXED CODE ###

# -*- coding: utf-8 -*-

a=int(input())
b=int(input())

s=2*b-a

print(s)
from collections import deque
n = int(input())
# 最終的に出力する色
colors = [-1] * n
# 重み付き無向グラフ
conns = [set() for _ in [0] * n] 

for x in range(1, n):
  v1, v2, dis = map(int, input().split())
  # (接続ノード, 重み) を加える
  conns[v1-1].add((v2-1, dis))
  conns[v2-1].add((v1-1, dis))

# BFSの為に根ノードを初期化. (基準ノード, 距離)
q = deque([(0, 0)])
# BFS開始
while q:
  v, dis, past = q.popleft()
  
  # 奇数なら1で,偶数なら0で塗る
  colors[v] = dis&1
  
  # 基準ノードから生える各エッジに対し
  for edge, w in conns[v]:
    
    # 根からここまでの距離を足しつつ,新しく探索先を追加.
    q.append((edge, dis + w))

print('\n'.join(map(str, colors)))

### FIXED CODE ###

n, k = map(int, input().split())
total_prob = 0
for i in range(1, n+1):
  dice_count = 0
  while (i << dice_count) < k:
    dice_count += 1
  
  total_prob += (1 / n) * (0.5 ** dice_count)
  
print(round(total_prob, 12))
import bisect
n,m=map(int,input().split())
def enum_dif(n):
    ret=[]
    i=1
    while i*i<=n:
        if(n%i==0):
            ret.append(i);
            if(i!=1 and i*i != n):
                ret.append(n//i)
        i+=1
    return ret
enum=enum_dif(m)
enum.sort()
# print(enum)
ind=bisect.bisect_left(enum,m//n)
if(enum[ind]==m//n):
    print(enum[ind])
else:
    print(enum[ind-1])

### FIXED CODE ###

# import bisect
n,m=map(int,input().split())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

div=make_divisors(m)
ans=1
for i in range(len(div)):
    if(div[i]>m/n):
        break
    ans=max(div[i],ans)
print(ans)
import itertools

def fff(x):
    dp=[0]*k
    dp[0]=1
    for u in itertools.chain(a[:x],a[x+1:]):
        h=dp[:]
        for i in range(u,k):
            h[i]=max(h[i],dp[i-u])
        dp=h
    for i in range(k-a[x],k):
        if dp[i]==1:
            return False
            break
    else:
        return True
        

n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
low=0
high=n-1
while high-low>1:
    mid=(high+low)//2
    if fff(mid):    #不必要
        low=mid
    else:
        high=mid

if fff(high):
    print(high+1)
else:
    print(low+1)
        

### FIXED CODE ###

import itertools

def fff(x):
    dp=[0]*k
    dp[0]=1
    for u in itertools.chain(a[:x],a[x+1:]):
        h=dp[:]
        for i in range(u,k):
            h[i]=h[i]|dp[i-u]
        dp=h
    cnt=0
    for i in range(max(0,k-a[x]),k):
        cnt+=dp[i]
    if cnt==0:
        return True
    else:
        return False

n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
low=0
high=n-1
while high-low>1:
    mid=(high+low)//2
    if fff(mid):    #不必要
        low=mid
    else:
        high=mid

if fff(high):
    print(high+1)
elif fff(low):
    print(low+1)
else:
    print(0)
import sys
N = int(sys.stdin.readline())
data = [0] * 10000
for i in map(int,sys.stdin.readline().split()):
	data[i] += 1
print(max(map(sum,zip(data,data[1:],data[2:]))))


### FIXED CODE ###

import sys
N = int(sys.stdin.readline())
data = [0] * 100000
for i in map(int,sys.stdin.readline().split()):
	data[i] += 1
print(max(map(sum,zip(data,data[1:],data[2:]))))
input()
li=list(map(int,input().split()))
for i in li:
	sum+=li
print(min(li),max(li),sum)


### FIXED CODE ###

input()
li=list(map(int,input().split()))
sum=0
for i in li:
	sum+=i
print(min(li),max(li),sum)
print('ACL' * input())

### FIXED CODE ###

print('ACL' * int(input()))
a, b, c  = [int(x) for x in input().strip().split()]

res = {x for seq in [range(a,min(a+c, b)), range(b, max(a,b-c), -1)] for x in seq}

if a==b:
    res = {a}

for x in sorted(list(res)):
    print(x)


### FIXED CODE ###

s = input()

if all(x in s for x in ['a', 'b', 'c']):
    print("Yes")
else:
    print("No")
a = float(input())
b = float(input())
print(int(a*(b*100))/100)

### FIXED CODE ###

import math
from decimal import Decimal
num = list(map(str,input().split(" ")))
print(math.floor(Decimal(num[1]) * Decimal(num[0])))
#!/usr/bin/env python3

N,M =map(int, input().split())
A =list(map(int, input().split()))
B = sorted(A, reverse = True)
if B[M] >= sum(B)/4/M:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N,M =map(int, input().split())
A =list(map(int, input().split()))
B = sorted(A, reverse = True)
if B[M-1] >= sum(B)/4/M:
    print("Yes")
else:
    print("No")
n,m,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a_num = 0
b_num = 0
while True:
    if a_num == len(a) and b_num == len(b):
        break
    elif b_num == len(b) and a[b_num] <= k and a_num < len(a):
        k -= a[a_num]
        a_num += 1
        continue
    elif a_num == len(a) and b[b_num] <= k and b_num < len(b):
        k -= b[b_num]
        b_num += 1
        continue
    elif a[a_num] <= k and a[a_num] <= b[b_num] and a_num < len(a):
        k -= a[a_num]
        a_num += 1
        continue
    elif b[b_num] <= k and b[b_num] < a[a_num] and b_num < len(b):
        k -= b[b_num]
        b_num += 1
        continue
    else:
        break
print(a_num + b_num)
        

### FIXED CODE ###

n,m,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
A = [0]
B = [0]
for i in range(n):
    A.append(A[i] + a[i])
for i in range(m):
    B.append(B[i] + b[i])
ans = 0
for i in range(n+1):
    if A[i] > k:
        break
    while B[m] > k-A[i]:
        m -= 1
    ans = max(ans,i+m)
print(ans)
#!/usr/bin/env python3
import sys
import math

def my_lcm(a: int, b: int):
    return int( abs(a*b) / math.gcd(a, b))

def nr_divide(a: int, b: int, x: int):
    return (int(math.floor(b/x)) - int(math.ceil(a/x))) + 1

def solve(A: int, B: int, C: int, D: int):
    E = my_lcm(C, D)
    N = B - A + 1
    nrC = nr_divide(A, B, C)
    nrD = nr_divide(A, B, D)
    nrE = nr_divide(A, B, E)
    print(N - nrC - nrD + nrE)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    solve(A, B, C, D)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import math
from fractions import gcd

def my_lcm(a: int, b: int):
    return  abs(a*b) // gcd(a, b)

def nr_divide(a: int, b: int, x: int):
    count = b//x - a//x + 1
    if a % x != 0:
        count -= 1
    return count

def solve(A: int, B: int, C: int, D: int):
    E = my_lcm(C, D)
    N = B - A + 1
    nrC = nr_divide(A, B, C)
    nrD = nr_divide(A, B, D)
    nrE = nr_divide(A, B, E)
    count = N - nrC - nrD + nrE
    print(count)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    solve(A, B, C, D)
    return

if __name__ == '__main__':
    main()
import sys
sys.setrecursionlimit(10**6)
def walk(n):
    global adj, point
    if len(adj[n])==0:
        return
    else:
        for a in adj[n]:
            point[a] += point[n]
        for a in adj[n]:
            walk(a)
N, Q = map(int, input().split())
adj = [[] for _ in range(N)]
point = [0 for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    adj[a-1].append(b-1)
for _ in range(Q):
    p, x = map(int, input().split())
    point[p-1] += x
walk(0)
print(" ".join(map(str, point)))

### FIXED CODE ###

a = int(input())
s = input()
if a>=3200:
    print(s)
else:
    print("red")
S, T = input().split()
print(T + S)


### FIXED CODE ###

S, T = input().split()
print(T + S)
N,M = map(int,input().split())
a = M - 2*N
if a <= 0:
    ans = C//2
else:
    a = a//4
    ans = N + a
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
a = M - 2*N
if a <= 0:
    ans = M//2
else:
    a = a//4
    ans = N + a
print(ans)
a,b = map(int,input().split())
ab = bin(a-1)[2:]
bb = bin(b)[2:]
# print(ab)
# print(bb)
sa = []
sb = []
if int(bb[-1]):
    sb = [1]
else:
    for i in bb:
        sb += [int(i)]
if a>0:
    if int(ab[-1]):
        sa = [1]
    else:
        for i in ab:
            # print(2)
            sa += [int(i)]
sa[-1] = (a//2)%2
sb[-1] = ((b+1)//2)%2
# print(sa)
# print(sb)
# print(ab)
ta = "".join([str(i) for i in sa])
tb = "".join([str(i) for i in sb])
ta = int(ta,2)
tb = int(tb,2)
# print(ta)
# print(tb)
ans = ta^tb
# print(ta)
# print(tb)
print(ans)

### FIXED CODE ###

a,b = map(int,input().split())
if a==0:
    print(b)
    exit()
ab = bin(a-1)[2:]
bb = bin(b)[2:]
# print(ab)
# print(bb)
sa = []
sb = []
if int(bb[-1]):
    sb = [1]
else:
    for i in bb:
        sb += [int(i)]
if a>0:
    if int(ab[-1]):
        sa = [1]
    else:
        for i in ab:
            # print(2)
            sa += [int(i)]
sa[-1] = (a//2)%2
sb[-1] = ((b+1)//2)%2
# print(sa)
# print(sb)
# print(ab)
ta = "".join([str(i) for i in sa])
tb = "".join([str(i) for i in sb])
ta = int(ta,2)
tb = int(tb,2)
# print(ta)
# print(tb)
ans = ta^tb
# print(ta)
# print(tb)
print(ans)
import math

n, m = map(int, input().split())
item_price = list(map(int, input().split()))
# n, m = (4, 4)
# item_price = [1, 9, 3, 5]
item_price.sort(reverse=True)
devided_two_price = [math.ceil(math.log2(i)) for i in item_price]
use_ticket_list = [0] * n
sum = 0

x = 0
a = 2
for i in range(m):
    if devided_two_price[x] == a:
        x += 1
        use_ticket_list[x] += 1
        devided_two_price[x] -= 1
    elif devided_two_price[x] >= devided_two_price[x+1]:
        use_ticket_list[x] += 1
        devided_two_price[x] -= 1
    else:
        x += 1
        use_ticket_list[x] += 1
        devided_two_price[x] -= 1
    if x == n:
        x = 0
        a -= 1

for i in range(n):
    sum += item_price[i] // (2**use_ticket_list[i])

print(sum)

### FIXED CODE ###

from heapq import heappush, heappop, heapify
import math

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

item_price_list = list(map(lambda x: x*(-1), item_price_list))
heapify(item_price_list)
for i in range(m):
    a = heappop(item_price_list)
    heappush(item_price_list, math.ceil(a/2))
    
print((-1)*sum(item_price_list))
# coding: utf-8

import sys
import math
import collections
import itertools
def input(): return sys.stdin.readline().strip()
def gcd(x, y): return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y): return (x * y) // gcd(x, y)
MOD = 10 **9 + 7

# N = int(input())
# S = input()
N, K = map(int, input().split())
# 横
A = [int(x) for x in input().split()]
# 縦
# A = [int(input()) for _ in range(N)]
# 多次元
# L = [[int(x) for x in input().split()] for _ in range(N)]

ans = 0
tmp = 0

for i, a in enumerate(A) :
    for aa in range(i + 1, N) :
        if a > A[aa] :
            ans += 1

for a in A :
    for aa in A :
        if a > aa :
            tmp += 1

print(((int((K*(K-1))//2)%MOD)*tmp+ans*K)%M)


### FIXED CODE ###

# coding: utf-8

import sys
import math
import collections
import itertools
def input(): return sys.stdin.readline().strip()
def gcd(x, y): return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y): return (x * y) // gcd(x, y)
MOD = 10 **9 + 7

# N = int(input())
# S = input()
N, K = map(int, input().split())
# 横
A = [int(x) for x in input().split()]
# 縦
# A = [int(input()) for _ in range(N)]
# 多次元
# L = [[int(x) for x in input().split()] for _ in range(N)]

ans = 0
tmp = 0

for i, a in enumerate(A) :
    for aa in range(i + 1, N) :
        if a > A[aa] :
            ans += 1

for a in A :
    for aa in A :
        if a > aa :
            tmp += 1

print(((int((K*(K-1))//2)%MOD)*tmp+ans*K)%MOD)
# -*- coding: utf-8 -*-
inputData = input()
ID, Gate = map(int, inputData.split())
x = []
for i in range(Gate):
    inputId = input()
    idStart, idEnd = map(int, inputId.split())
    idList = list(range(idStart, idEnd + 1))
    x.append(idList)

# print(x[0])


def solve():

    for i in range(len(x)):
        if i == 0:
            matched = set(x[0])
            continue

        tempX = set(x[i])
        # print('++')
        # print(matched)
        # print(tempX)
        matched = set(list(matched & tempX))
        # print(matched)
        if len(matched) == 0:
            #
            return 0

    return len(matched)


ans = solve()
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
inputData = input()
age, price = map(int, inputData.split())

if age >= 13:
    ans = price
elif age >= 6:
    ans = price / 2
else:
    ans = 0

print(int(ans))
n,k=map(int,input().split())
l=[int(_) for _ in input().split()]
l.sort()
sum=0
for i in range(k):
  sum+=l[k]
print(sum)

### FIXED CODE ###

n,k=map(int,input().split())
l=[int(_) for _ in input().split()]
l.sort()
 
ans=0
for i in range(k):
  ans+=l[i]
print(ans)
LR = input().split()
L = int(LR[0])
R = int(LR[1])
S = []

if R - L > 2019:
    print("0")
else:
    for i in range(L,R-1):
        for j in range(i-1,R):
            S.append(i * j % 2019)
    print(min(S))




### FIXED CODE ###


LR = input().split()
L = int(LR[0])
R = int(LR[1])
S = []

if R - L >= 2019:
    print("0")
else:
    for i in range(L,R):
        for j in range(i+1,R+1):
            S.append(i * j % 2019)
    print(min(S))
a,b = map(int, input().split())
  
  if a*b % 2 == 0:
    print("Even")
  else:
    print("Odd")


### FIXED CODE ###

a, b = map(int, input().split())
print("Odd" if a * b % 2 else "Even")
from sys import stdin
import numpy as np
input = stdin.readline

N = int(input())
A_list = list(map(int, input().split()))
ans_list =np.ones(N)
A_list = np.array(A_list)

for i in range(N):
    for j in range(i+1,N):
        if A_list[i] %  A_list[j] == 0:
            ans_list[i] = 0
            if (A_list[j] %  A_list[i] == 0):
                ans_list[j] = 0
        elif A_list[i] ==  A_list[j]:
                ans_list[i] = 0
                ans_list[j] = 0
        elif(A_list[j] %  A_list[i] == 0):
            ans_list[j] = 0
print(int(np.sum(ans_list)))

### FIXED CODE ###

from sys import stdin
input = stdin.readline

x, n  = map(int, input().split())
p_list = list(map(int, input().split()))

if n == 0:
    print (x)
    exit()

li = []
# res = float('inf')
# for i in n:
#      std = abs(x - p_list[i])
#      if std <= res:
#          res = std    
def dfslower(std) :
    """
    argument x : 基準となる数字
    y 結果となりうる数字？
    return : 結果
    """
    if std  in p_list:
        return dfslower(std-1)
        #print(std)
    else:
        return std
        

def dfsupper(std) :
    """
    argument x : 基準となる数字
    y 結果となりうる数字？
    return : 結果
    """
    if std  in p_list:
        return dfsupper(std+1)
        #print(std)
    else:
        return(std)

mininte = dfslower(x)
maxinte =  dfsupper(x)

if abs(mininte-x)> abs(maxinte -x):
    print(maxinte)
elif abs(mininte-x) <= abs(maxinte -x):
    print(mininte)
N = int(input())
A = list(map(int, input().split(" ")))


dp_dict = {}


def dp(i, j):
    if j == 1:
        return A[i]
    if (i-1)//2 > (N//2)-j:
        return -1*10e+9
    if (N-1)-i < j:
        return -1*10e+9

    if (i, j) in dp_dict:
        return dp_dict[(i, j)]
    else:
        temp = max([dp(i+2, j-1)+A[i], dp(i+1, j)])
        dp_dict[(i, j)] = temp
        return temp


print(dp(0, N//2))

### FIXED CODE ###

N = int(input())
A = [0]+list(map(int, input().split(" ")))

dp_list = [{0, 0}, {0: 0, 1: A[1]}, {0: 0, 1: A[1] if A[1] > A[2] else A[2]}]

for i in range(3, N+1):
    b = (i-1)//2
    f = (i+1)//2
    dp_list.append({})
    for j in range(b, f+1):
        if j in dp_list[i-1]:
            dp_list[i][j] = dp_list[i-2][j-1]+A[i] if dp_list[i -
                                                              2][j-1]+A[i] > dp_list[i-1][j] else dp_list[i-1][j]
        else:
            dp_list[i][j] = dp_list[i-2][j-1]+A[i]

print(dp_list[-1][N//2])
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
def check():
  deltaD=B-A
  deltaV=V-W
  if deltaD<0:
    return 'NO'  
  if deltaD==0:
    return 'YES'
  if deltaV<=0:
    return 'NO'
  if deltaV>0:
     if T>=deltaD//deltaV:
       return 'YES'
  return 'NO'

print(check())

### FIXED CODE ###

#
print(input()[0:3])
l, r = map(int, input().split())
 
v = []

if l*r < 2019:
    print(l*r)
else:
    c = r - l
    for i in range(l, l + c):
        for j in range(i+1, l + c):
            v.append(i*j%2019)
            if v[-1] == 0:
                break
        else:
            continue
        break

    print(min(v))

### FIXED CODE ###

l, r = map(int, input().split())
 
v = []
if l*r < 2019:
    print(l*r)
else:
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            v.append(i*j%2019)
            if v[-1] == 0:
                break
        else:
            continue
        break
 
    print(min(v))
1 N, M, K = map(int, input().split())
2 A = list(map(int, input().split()))
3 B = list(map(int, input().split()))
4
5 a, b = [0], [0]
6 for i in range(N):
7 　　a.append(a[i] + A[i])
8 for i in range(M):
9 　　b.append(b[i] + B[i])
10
11 ans, j = 0, M
12 for i in range(N + 1):
13 　　if a[i] > K:
14 　　　　break
15　　 while b[j] > K - a[i]:
16 　　　　j -= 1
17 　　ans = max(ans, i + j)
18 print(ans)


### FIXED CODE ###

import numpy as np


def main():
    N, M, K = map(int, input().split())
    A = np.array([0] + [int(i) for i in input().split()])
    B = np.array([0] + [int(i) for i in input().split()])

    A.cumsum(out=A)
    B.cumsum(out=B)

    ans = 0
    j = M
    for i in range(N + 1):
        if A[i] > K:
            break
        while B[j] + A[i] > K:
            j -= 1
        ans = max(ans, i + j)

    print(ans)


if __name__ == '__main__':
    main()
import math
N = int(input())
A = [int(i) for i in input().split()]

ans = A[0]

for a in A:
  ans = math.gcd(ans,a)

print(ans)


### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

ans = A[0]

for a in A:
  ans = gcd(ans,a)

print(ans)
s = input()
k = int(input())
if k == 1 and s[0] == '1':
  print(s[0])
else:
  print(s[1])

### FIXED CODE ###

s = input()
k = int(input())
i = 0
l = len(s)
while s[i] == '1':
  if i >= l-1:
    break
  i += 1
if i == 0 or k <= i:
  print(s[0])
else:
  print(s[i])
n = int(input())
vlist = list(map(int, input().split()))

a = max(vlist[::2])
b = max(vlist[1::2])

x = len(a) - vlist[::2].count(a)
y = len(b) - vlist[1::2].count(b)

print(x+y)

### FIXED CODE ###

from collections import Counter

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

# most_commonを使うためにリストをCounterオブジェクトに渡す
Counter_evens = Counter(vlist[::2])
Counter_odds = Counter(vlist[1::2])


# even_indexes
top2_even = Counter_evens.most_common(2)  # [(一番多い要素,その出現回数),(2番目に多い要素,その出現回数)]

E_most_common = top2_even[0][0]
Emnum = top2_even[0][1]

if len(top2_even) == 2:
    E_2nd_common = top2_even[1][0]
    E2num = top2_even[1][1]
else:
    E_2nd_common = 'foo'
    E2num = 0

# odd_indexes
top2_odd = Counter_odds.most_common(2)

O_most_common = top2_odd[0][0]
Omnum = top2_odd[0][1]

if len(top2_odd) == 2:
    O_2nd_common = top2_odd[1][0]
    O2num = top2_odd[1][1]
else:
    O_2nd_common = 'foo'
    O2num = 0


if E_most_common == O_most_common:  # most commonどうしが衝突してしまっている。
    # もし偶数番目・奇数番目をどちらもmost commonに書き換えると、3つ目の条件「数列は1種類の数ではだめ」が満たされない。
    # なので奇数番目・偶数番目のどちらかは2番目に多いやつに書き換える必要がある

    # 偶数番目をmost commonに、oddsを2nd commonにそろえる場合に書き換えないといけない要素の数
    x = len(vlist[::2]) - Emnum + len(vlist[1::2]) - O2num
    # 逆の場合
    y = len(vlist[::2]) - E2num + len(vlist[1::2]) - Omnum

    print(min(x, y))
else:
    # most common は衝突していない、つまり異なる数。よって3つ目の条件「数列は1種類の数ではだめ」は満たされている。
    # 両方とも most commonに書き換えてOK
    print(len(vlist[::2]) - Emnum + len(vlist[1::2]) - Omnum)
S = input()
T = input()
ans = 0
for i in range(len(T)):
    if len(S) > 10:
        break
    if S[i] == T[i]:
        ans = 0
    else:
        ans = 1

if ans == 0:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

S = input()
T = input()
ans = 0
for i in range(len(S)):
    if len(S) > 10:
        break
    if len(T) != len(S) + 1:
        break
    if S[i] == T[i]:
        ans = 1
    else:
        ans = 0
        break

if ans == 1:
    print('Yes')
else:
    print('No')
input_a = input()
input_b = input()
input_x = input()
a = int(input_a)
b = int(input_b)
x = int(input_x)
if a < x:
    print("NO")
elif a+b < x:
    print("NO")
else:
    print("YES")

### FIXED CODE ###

A,B,X = map(int,input().split())
if A<=X and A+B>=X:
  print("YES")
else :
  print("NO")
N, Q = [int(n) for n in input().split()]

tree_list = {n:[] for n in range(1, N+1)}
count_list = {n:0 for n in range(1, N+1)}

for i in range(N-1):
    a, b = [int(n) for n in input().split()]
    tree_list[a].append(b)

#print(tree_list)
#print(count_list)

for j in range(Q):
    p, x = [int(n) for n in input().split()]
   
    def func(pn):
        count_list[pn] += x
        for k in tree_list[pn]:
            func(k)
    
    func(p)
    
#print(count_list)

print(' '.join([str(v) for k, v in count_list.items()]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
N, Q = [int(n) for n in input().split()]
tree_list = [[] for _ in range(N)]

for i in range(N-1):
    a, b = [int(n)-1 for n in input().split()]
    tree_list[a].append(b)
    tree_list[b].append(a)

score_list = [0] * N
for j in range(Q):
    p, x = [int(n) for n in input().split()]
    score_list[p-1] += x

reached = [False] * N
def dfs(v):
    reached[v] = True
    for next_v in tree_list[v]:
        if reached[next_v] == True:
            continue
        score_list[next_v] += score_list[v]
        dfs(next_v)
dfs(0)
print(*score_list)
N , K = [int(n) for n in input().split()]
S = input()
print(S[:K]+S[k].lower()+S[K:])

### FIXED CODE ###

N , K = [int(n) for n in input().split()]
S = input()
print(S[:K-1]+S[K-1].lower()+S[K:])