peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
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])

res = 0
j = M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    res = max(res, i+j)
print(res)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
h = int(input())

print(((a + b) * h) / 2)
# Judge status: Wrong Answer
a = input().split()
print(int(a[1]) + 100*(10-int(a[0])))
# Judge status: Accepted
import itertools
n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
permutations_lis = itertools.permutations(range(1,n+1))# 全ての場合のリストを生成
dis_list = []
for i,case in enumerate(permutations_lis):
    if list(case) == p :
        a = i 
    if list(case) == q :
        b = i
print(abs(a-b))
# Judge status: Accepted
import sys

A, B = map(int, sys.stdin.readline().split())
if A <= 5:
    print(0)
elif A <= 12:
    print(B // 2)
else:
    print(B)
# Judge status: Accepted
# -*- coding: utf-8 -*-

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

k = 1
count = 0
while k < B:
    k = (k - 1) + A
    count = count + 1

print(count)
# Judge status: Wrong Answer
n,m=map(int,input().split())
arr=[list(map(int,input().split())) for _ in range(m)]
count=[1]*(n+1)
flag=[False]*(n+1)
flag[1]=True
for a,b in arr:
  count[b]+=1
  count[a]-=1
  if flag[a]==True:
    flag[b]==True
  if count[a]==0:
    flag[a]==False
print(flag.count(True))
# Judge status: Accepted
a5=[i**5 for i in range(300)]
x=int(input())
flag=0
for i in range(300):
  for j in range(300):
    if flag==0 and a5[i]-a5[j]==x:
      print(str(i)+" "+str(j))
      flag=1
    if flag==0 and a5[i]+a5[j]==x:
      print(str(i)+" -"+str(j))
      flag=1
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))
cnt=1
ans=0
for i in range(len(A)):
    if A[i]==cnt:
        cnt+=1
    else:
        ans+=1
if ans==len(A):
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
m,n = list(map(int,input().split(" ")))
l = list(map(str,input().split(" ")))

a = m

while 1:
    for i in str(a):
        if i in l:
            a += 1
            break
        else:
            print(a)
            exit()
# Judge status: Wrong Answer
import numpy as np

a = input()
s = list(a)

index = []
index.append(a.find('?')+1)

i = 0
while a.find('?',index[i]) != -1:
  tmp = a.find('?',index[i])
  index.append(tmp + 1)
  i = i + 1

score = a.count('D') + a.count('PD')

for i in range(len(index)):
  s[index[i]-1] = 'D'
  score = score + 1
  
s = "".join(s)
print(s)
# Judge status: Wrong Answer
N=int(input())
x=list(map(int,input().split()))

for i in range(N):
  count=0
  while x[i]%2==0:
    x[i]/=2
    count+=1
    
print(count)
# Judge status: Accepted
n,p = map(int,input().split())
a = list(map(int,input().split()))

# dp[i][p]:i番目まで見たとき、余りがpとなる選び方
dp = [[0 for _ in range(2)] for _ in range(n+1)]
dp[0][0] = 1
for i in range(n):
  if a[i]%2 == 0:
    dp[i+1][0] = dp[i][0]*2
    dp[i+1][1] = dp[i][1]*2
  else:
    dp[i+1][0] = dp[i][0]+dp[i][1]
    dp[i+1][1] = dp[i][0]+dp[i][1]
print(dp[n][p])
#print(dp)
# Judge status: Accepted
N, M = map(int, input().split())
if N < M:
  print('No')
else:
  A = [input() for _ in range(N)]
  B = ''
  cnt = 0
  for _ in range(M):
    B += input().rstrip()
  for i in range(N-M+1):
    if cnt==1:
      break
    for j in range(N-M+1):
      judge = ''
      for k in range(M):
        judge += A[i+k][j:j+M]
      if judge == B:
        cnt += 1
        break
  if cnt == 1:
    print('Yes')
  else:
    print('No')
# Judge status: Wrong Answer
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
sorted(CT,key=lambda x: x[0])
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    break
# Judge status: Wrong Answer
N=int(input())
p=[]
count=0
for i in range (N):
  a=int(input())
  p.append(a)
list.sort(p)
flag=1
for j in range (N-1):
  if p[j]==p[j+1]:
    flag*=-1
  else:
    if flag>0:
      count+=1
    flag=1
if flag<0:
  count+=1
print(count)
# Judge status: Accepted
# -*- coding: utf-8 -*-

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

if s[:a].isdecimal() and s[a]=='-' and s[a+1:].isdecimal():
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a = int(input())
print((a**3)+(a**2)+a)
# Judge status: Accepted
#30 C - 4-adjacent
N = int(input())
A = list(map(int,input().split()))

multiple4 = 0
multiple2 = 0
for a in A:
    if a%4 == 0:
        multiple4 += 1
    elif a%2 == 0:
        multiple2 += 1

odd = N - (multiple4 + multiple2)
result = 'No'
if odd <= multiple4:
    result = 'Yes'
elif ((odd - 1) <= multiple4) and (multiple2%2 == 0):
    result = 'Yes'
print(result)
# Judge status: Wrong Answer
print("Yes" if int(input()) in [7, 5, 3] else "No")
# Judge status: Accepted
s, c = map(int, input().split())
print(min(s, c // 2) + max(0, c - 2 * s) // 4)
# Judge status: Wrong Answer
a, b = list(map(int, input().split()))
print("Possible") if (a + b) % 3 == 0 else print("Impossible")
# Judge status: Accepted
n,W = map(int,input().split())
w = []
v = []
dp = [[0]*(W+1) for _ in range(n+1)]
for _ in range(n):
    w1,v1 = map(int,input().split())
    w.append(w1)
    v.append(v1)
    
for i in range(n):
    for sumw in range(W+1):
        if sumw -w[i]>=0:
            dp[i+1][sumw] = max(dp[i+1][sumw],dp[i][sumw-w[i]]+v[i])
        dp[i+1][sumw] = max(dp[i][sumw],dp[i+1][sumw])
print(dp[n][W])
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
def nC2(n):
  # n = 0 -> 0
  # n = 1 -> 0
  if n<2:
    return 0
  return math.factorial(n) // (math.factorial(n - 2) * 2)
n,m = map(int, input().split())
# 135 3C2
# 2468 4C2
# nC2
r=nC2(n)+nC2(m)
print(r)
# Judge status: Wrong Answer
import math
n = int(input())
print(math.ceil(n/1.08)*(math.ceil(n/1.08) == math.floor(-~n/1.08)) or ":(")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

x = A[0]
y = sum(A[1:])
ans = abs(y - x)
for i in range(1, N - 1):
    x += A[i]
    y -= A[i]
    ans = min(ans, abs(y - x))
print(ans)
# Judge status: Accepted
N = int(input())
d_list = list(map(int, input().split()))
d_list.sort()
mid_1 = d_list[len(d_list) // 2 - 1]
mid_2 = d_list[len(d_list) // 2]
ans = mid_2 - mid_1
print(ans)
# Judge status: Accepted
import numpy as np

N, K = map(int, input().split(' '))
A = tuple(map(int, input().split(' ')))
indexes = np.arange(0, N)

dp = np.zeros(shape=N + 1, dtype=np.int64)

for k in range(K):
    np.add.at(dp, np.maximum(0, indexes - A), 1)
    np.add.at(dp, np.minimum(N, indexes + A + 1), -1)
    A = dp.cumsum()[:-1]
    if np.all(A == N):
        break
    dp *= 0

print(' '.join(map(str, A)))
# Judge status: Accepted
x=int(input())
a=x//11
b=((x-1)%11)//6+1 if x%11!=0 else 0
print(a*2+b)
# Judge status: Wrong Answer
N = int(input())
eat_list = list(map(int, input().split()))
manzok_list = list(map(int, input().split()))
add_manzok_list = list(map(int, input().split()))

manzok = 0

for i in range(N):
 manzok += manzok_list[eat_list[i]-1]
 if(i > 0 and (eat_list[i] - eat_list[i-1]) == 1):
   print(i)
   manzok += add_manzok_list[eat_list[i-1]-1]

print(manzok)
# Judge status: Accepted
q, h, s, d = map(int, input().split())
n = int(input())
print((n//2) * min(2*min(4*q, 2*h, s), d) + (n%2) * min(4*q, 2*h, s))
# Judge status: Accepted
import numpy as np
N = int(input())
li = []
for n in range(N):
    li.append([int(i) for i in list(input().split())])
arr = np.array(li)
ruiseki = 0
for a in arr[np.argsort(arr[:,1], axis=0)]:
    if ruiseki + a[0] > a[1]:
            yn = "No"
            break
    else:
        yn = "Yes"
        ruiseki+=a[0]
print(yn)
# Judge status: Wrong Answer
a,b,x = map(int,input().split())
num = a
cnt = 0

while a <= num <= b and num % x == 0:
    cnt += 1
    num += x
print(cnt)
# Judge status: Accepted
W,H,N = map(int, input().split())
w=[0]*W
h=[0]*H
for i in range(N):
    x,y,a = map(int, input().split())
    if a==1:
        for i in range(x):
            w[i]=1
    if a==2:
        for i in range(x,W):
            w[i]=1
    if a==3:
        for i in range(y):
            h[i]=1
    if a==4:
        for i in range(y,H):
            h[i]=1
 
print(w.count(0)*h.count(0))
# Judge status: Accepted
a,b=map(int,input().split())
n=b-a
summy=((n+1)*n)/2
print(int(summy-b))
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())

for i in range(k):
    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2
    else:
        c *= 2

if a < b and b < c:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())

cnt=0
ans=0

for i in range(1,N+1):
    if N%i ==0:
        cnt+=1
    if cnt ==8:
        ans+=1

print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline

Num_str = list(input().rstrip())
L = len(Num_str)
Num = []

for n in reversed(Num_str):
    Num.append(int(n))

S = 0
up = False
for i, n in enumerate(Num):
    if up:
        n += 1
    if n < 5:
        S += n
        up = False
    elif n == 5:
        S += 5
        up = (i != L-1 and Num[i+1] >= 5)
    else:
        S += 10 - n
        up = True
if up:
    S += 1
print(S)
# Judge status: Accepted
D=int(input())
c=list(map(int,input().split()))
last=[0 for i in range(26)]
cost=[0 for i in range(26)]
degree=[0 for i in range(26)]
s=[]
for _ in range(D):
  s.append(list(map(int,input().split())))

for d in range(D):
  for i in range(26):
    cost[i]=c[i]*(d-last[i])
    degree[i]=s[d][i]-cost[i]
  k=degree.index(max(degree))
  last[k]=d
  print(k+1)
# Judge status: Accepted
a,b,c= map(int,input().split())
if c>a+b and 4*a*b<(c-a-b)*(c-a-b):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
d = sorted([int(i) for i in input().split()])
print(d[n // 2] - d[n // 2 - 1])
# Judge status: Accepted
s = input()
if len(s)%2 == 0:
    s = s[:-2]
else:
    s = s[:-1]

for i in range(len(s)//2):
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        break
    else:
        s = s[:-2]
# Judge status: Wrong Answer
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    a, b, c = MI()
    ans = a*b*0.5
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
S = set(input())

if len(S) == 3:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys

stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


a, b, t = nm()
print(int(((t + 0.5) // a) * b))
# Judge status: Wrong Answer
import math

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

y = (a ** 2) * b / 2
if x == a**2*b/2:
    print(0)
elif x <= a**2*b/2:
    z = a*b**2 / (2*x)
    print(math.degrees(math.atan(z)))
else:
    z = 2 * (a ** 2 * b - x) / a ** 3
    print(math.degrees(math.atan(z)))
# Judge status: Accepted
N = int(input())

ST = []
for i in range(N):
    X, L = map(int, input().split())
    ST.append((X - L, X + L))

ST.sort(key=lambda x: x[1])

ans = 0
cur = -1e9
for i in range(N):
    S, T = ST[i]
    if cur <= S:
        ans += 1
        cur = T
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-

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

ans = 0

ans = 0
for k in range(N, 0, -1):
    mi = int(N/k)
    sum_num = (1+mi) * (mi//2) if mi%2==0 else mi * ((mi-1)//2) + mi
    ans += k * sum_num

print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())

cnt = int(N / K) + 1

print(min(abs(N - (K * cnt)), abs(N - (K * (cnt-1))), N))
# Judge status: Accepted
print(('consonant','vowel')[input()in'aiueo'])
# Judge status: Wrong Answer
import math

k = 1
x = float(input())
while  x*k%360 == 0:
  k += 1	
print(k)
# Judge status: Accepted
def main():
    n = int(input())
    a = list(map(int, input().split()))

    ans = []
    for i in range(n):
        ans.append(0)
    for x in a:
        ans[x-1] += 1

    for x in ans:
        print(x)

if __name__ == '__main__':
    main()
# Judge status: Accepted
x = int(input())

t = 0
while True:
    if not (t*(t+1))/2 >= x:
        t += 1
    else:
        break
print(t)
# Judge status: Wrong Answer
d,t,s = map(int, input().split())
print('Yes' if d//s <= t else 'No')
# Judge status: Accepted
n = int(input())
s = []
while True:
    try:
        s.append(input())
    except EOFError:
        break

word_counter = {}
for word in s:
    if word in word_counter:
        word_counter[word] += 1
    else:
        word_counter[word] = 0

results = sorted(word_counter.items(), key=lambda x: x[1], reverse=True)
max_v = results[0][1]

pick_ups = [result[0] for result in results if result[1] == max_v]
sorted_pick_ups = sorted(pick_ups)
print(*sorted_pick_ups, sep='\n')
# Judge status: Accepted
n = int(input())
s = input()

for i in s:
  if ord(i) + n > 90:
    print(chr(ord(i) + n - 91 + 65), end='')
  else:
    print(chr(ord(i) + n), end='')
# Judge status: Accepted
icase=0
if icase==0:
    a,b=map(int,input().split())
    n=b-a-1
    print(n*(n+1)//2-a)
# Judge status: Wrong Answer
N = int(input())


## 約数の列挙O(√N)
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return len(table)
  
i = 1
answer = 0
while i < N:
  if divisor(i) == 8:
    answer += 1
  i += 2
print(answer)
# Judge status: Wrong Answer
a, b, c = map(int,input().split())
print('YES') if a == b == c else print('NO')
# Judge status: Wrong Answer
import collections
S=sorted(str(input()))
#print(*S)
A=[]
L = collections.Counter(S)
values, counts = zip(*L.most_common())
for i in range(len(values)):
  A.append(values[i])
A.sort()

x=0
for i in range(len(A)):
  if ord(A[i])!=i+97:
    x=i+97
    break
    
print(chr(i+97) if x!=0 else "None")
# Judge status: Wrong Answer

x,y = map(int,input().split())

a = [1,3,5,7,8,10,12]
b = [4,6,9,11]

if x in a and y in a:
    print("Yes")
elif x in b and y in a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
if n == 1:
  print(n)
else:
  print(int(n * (n + 1) / 2))
# Judge status: Wrong Answer
K,N = map(int,input().split())	
li = list(map(int,input().split()))	
le = []
for i in range(N):
    if i==N-1:
        le.append(K-li[i])
    else: 
        le.append(abs(li[i]-li[i+1]))
print(sum(le)-max(le))
# Judge status: Accepted
w,a,b = map(int, input().split())
print(max(0,b-(a+w),a-(b+w)))
# Judge status: Accepted
K = input()
K = int(K)

def seven():
    seven_i = 0
    count = 0
    for i in range(K):
        seven_i = ((10*seven_i) + 7) % K
        count += 1
        if seven_i % K == 0:
            return count
    return -1

print(seven())
# Judge status: Accepted
a, b, k = map(int,input().split())
ans = []
if 2*k >= b-a+1:
    ans = list(range(a,b+1))

else:
    for i in range(k):
        ans.append(a+i)
    for i in range(k):
        ans.append(b-k+i+1)

for i in range(len(ans)):
    print(ans[i])
# Judge status: Accepted
import sys
input = sys.stdin.readline


def main():
    x = int(input())
    total = 0
    i = 1
    cnt = 0
    while total < x:
        total += i
        i += 1
        cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a-b<=1:
  print('Yay!')
else:
  print(':(')
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
l=1
r=a[-1]
while r-l>1:
  cnt=0
  m=(l+r)//2
  #print("l,m,r",l,m,r)
  for i in a:
    cnt+=(i-1)//m
  if cnt<=k:
    r=m
  else:
    l=m
print(r)
# Judge status: Accepted
import string
alphabet = set(list(string.ascii_lowercase))
s = set(input())
rest = sorted(alphabet - s)

ans = rest[0] if rest else 'None'

print(ans)
# Judge status: Wrong Answer
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]


A.sort()
B.sort()
C.sort()

import bisect
ans = 0

a2b = []
b2c = []
for c in C:
    b_bisect = bisect.bisect_right(B, c)
    a2b.append(b_bisect)
    
for b in B:
    a_bisect = bisect.bisect_right(A, b)
    b2c.append(a_bisect)

for i, j in zip(a2b, b2c):
    ans += i*j
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
A = []

for _ in range(K):
    d = input()
    tmp = list(map(int, input().split()))
    for i in tmp:
        A.append(i)

B = set(A)
print(N - len(B))
# Judge status: Wrong Answer
N = input()
cnt =0
for i in range(3):
    if N[i]==N[i+1]:
        cnt += 1

if cnt>=2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
with open(0) as f:
    C = [list(map(int, line.split())) for line in f.readlines()]
b = [(C[i][1]-C[i][0], C[i][2]-C[i][1]) for i in range(3)]
a = [(C[1][j]-C[0][j], C[2][j]-C[1][j]) for j in range(3)]
print('Yes' if a[0]==a[1]==a[2] and b[0]==b[1]==b[2] else 'No')
# Judge status: Wrong Answer
h , a = map(int , input().split())

print(h // a + 1)
# Judge status: Accepted
A, B = map(int, input().split())

list = [(2*A-1), (A+B), (2*B-1)]

print(max(list))
# Judge status: Wrong Answer
n = int(input())
d = sorted(list(map(int, input().split())))

print(d)

if d[n//2-1] == d[n//2]:
    print(0)
else:
    print(d[n//2] - d[n//2-1])
# Judge status: Accepted
import heapq

n, m = map(int, input().split())
a = list(map(int, input().split()))
a = list(map(lambda x: x * (-1), a))

heapq.heapify(a)
for i in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a, (-1) * (-x // 2))

print(-sum(a))
# Judge status: Wrong Answer
whatMan = []

N, K = input().split()
for i in range(int(K)):
    print(input().split())
# Judge status: Accepted
A, B = map(int, input().split())
S = input()

match = True
for i in range(A+B+1):
    if i == A:
        if S[i] != "-":
            print("No")
            match = False
            break
    else:
        if S[i] not in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]:
            print("No")
            match = False
            break
            
if match:
    print("Yes")
# Judge status: Accepted
#!/usr/bin/env python3

def rating(X):
    if X <= 599: return 8
    if X <= 799: return 7
    if X <= 999: return 6
    if X <= 1199: return 5
    if X <= 1399: return 4
    if X <= 1599: return 3
    if X <= 1799: return 2
    if X <= 1999: return 1

    assert(False)


X = int(input())
print(rating(X))
# Judge status: Accepted
a,b,c,x,y=map(int,input().split())
r=float('inf')
for i in range((10**5)+1):
  r=min(r,i*2*c+max(0,x-i)*a+max(0,y-i)*b)
print(r)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=[]
s=0
for aa in a:
  s^=aa
for aa in a:
  b.append(s^aa)
print(*b)
# Judge status: Accepted
A, B = map(int,input().split())
out = 1 
ans = 0

while out < B:
  out += A-1
  ans += 1

print(ans)
# Judge status: Accepted
def main():
    import sys
    input = sys.stdin.readline
    D, N = map(int, input().split())
    if N != 100:
        print(N, end="")
        for i in range(D):
            print("00", end="")
        print("")
    else:
        print(100 ** (D+1) + 100 ** D)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())

L0 = 2
L1 = 1
if N == 1:
    print(L1)
    exit()
for _ in range(N - 1):
    L = L0 + L1
    L0 = L1
    L1 = L

print(L)
# Judge status: Accepted
def main():
    from math import ceil

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

    ans = ceil((N - K) / (K - 1)) + 1
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())
# Judge status: Accepted
s = input()
if s[0]=="A":
    checker = 0
    for i in range(2, len(s)-1):
        if s[i] =="C":
            checker += 1
    if checker == 1:
        checker = 0
        for i in range(len(s)):
            if ord(s[i])<97:
                checker += 1
        if checker == 2:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
# Judge status: Wrong Answer
n = int(input())

s = ''
while(n != 0):
    s = str(n % 2)+s
    n = -(n//2)
print(s)
# Judge status: Wrong Answer
N = int(input())
S = input()
n = int(N/2) - 1
if len(S) % 2 == 1:
  print('No')
else:
  for i in range(n):
    if S[i] == S[i + int(N/2)]:
      print('Yes')
      exit(0)
  print('No')
# Judge status: Accepted
def main():
  n=int(input())
  a=sorted([int(input()) for _ in [0]*n])
  a.append(0)
  a=tuple(a)
  cnt,x,ans=0,a[0],0
  for i in a:
    if x==i:
      cnt+=1
    else:
      ans+=1 if cnt%2==1 else 0
      cnt,x=1,i
  print(ans)
if __name__=='__main__':
  main()
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))

total = sum(A)
if N < total:
    print(-1)
else:
    print(N-total)
# Judge status: Accepted
n = int(input())
a = int(input())
if n%500 <= a:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
ls1 = []
ls2 = []
ls3 = []
ans = []
for i in range(N):
    s = input()
    ls1.append(s)
    ls3.append(s)
M = int(input())
for j in range(M):
    t = input()
    ls2.append(t)
    ls3.append(t)
k = set(ls3)
p = list(k)
for i in range(len(p)):
    ans.append(ls1.count(p[i])-ls2.count(p[i]))
print(max(ans))
# Judge status: Accepted
import sys,math,collections,itertools
input = sys.stdin.readline

N = int(input())
A = list(map(int,input().split()))
m = 10**9+7
sumA = 0
for i in range(60):
    cnt1 = 0
    for a in A:
        if a>>i & 1:
            cnt1 += 1
    sumA += (cnt1*(N-cnt1)*2**i)%m
print(sumA%m)
# Judge status: Accepted
N, M = map(int, input().split())

def solve(N,M):
    if N==1 and M==1:
        return 1
    if N==1:
        return M-2
    if M==1:
        return N-2
    ans = (N-2)*(M-2)
    return ans
print(solve(N,M))
# Judge status: Accepted
N = int(input())
ans = []
while N != 0:
    if  N % 2 != 0:
        N -= 1
        ans.append("1")
    else:
        ans.append("0")
    N //= -2

if ans:
    print("".join(reversed(ans)))
else:
    print("0")
# Judge status: Accepted
import collections
def prime_factorize(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())

if N == 1:
	print(0)
	exit()

c = collections.Counter(prime_factorize(N))

ans = 0
for m in c.values():
	n = 1
	while (n*(n+1))//2 <= m:
		ans += 1
		n += 1
print(ans)
# Judge status: Accepted
N = int(input())
nums = list(map(int, input().split()))

d4 = 0
d2 = 0
d0 = 0
for n in nums:
    if n % 4 == 0:
        d4 += 1
    elif n % 2== 0:
        d2 += 1
    else:
        d0 += 1

if d2 > 0 and d0 <= d4:
    print('Yes')
elif d2 == 0 and d0 <= d4+1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
in_ = list(input().split())
A = int(in_[0])
B = int(in_[1].replace(".", ""))
ans = A * B
ans = ans // 100
print(ans)
# Judge status: Wrong Answer
import math
n,k = list(map(int, input().split()))
print(sum([(1/2)**math.ceil(math.log2(k/(i+1)))/n for i in range(n)]))
# Judge status: Accepted
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b,c = map(int, input().split())
    if max(a,b,c) == a+b+c-max(a,b,c):
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import numpy as np

s_list = [int(i) for i in list(input())]
ans = np.count_nonzero(s_list!=0)

print(ans)