peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a, b, c = map(int, input().split())
if a <= c <= b:
    print("Yes")
    raise SystemExit(0)
print("No")
# Judge status: Wrong Answer
import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    k, n = map(int, readline().rstrip().split())
    A = sorted(list(map(int, readline().rstrip().split())))
    maxA = k + A[0] - A[n-1]
    for i in range(n-1):
    	a = abs(A[i+1] - A[i])
    	maxA = max(maxA,a)
    print(maxA)



if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    K, S = map(int, input().split())

    ans = 0
    X_max = min(S, K)
    for X in range(X_max + 1):
        Y_max = min(S - X, K)
        for Y in range(Y_max + 1):
            Z = S - (X + Y)
            if 0 <= Z <= K:
                ans += 1
            else:
                continue
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import math

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

N2 = 0
N4 = 0

for i in a:
    if i % 4 == 0:
        N4 += 1
    if i % 2 == 0:
        N2 += 1

if N4 >= math.ceil(N / 3) or N2 >= math.ceil(N*2/3):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x, y = map(int, input().split())
judge='No'
if(y%2==1):
  judge='No'

for i in range(x):
  if(x==1 and (y==4 or y==2)):
    judge='Yes'
  if(y%4==0):
    judge='Yes'
  for j in range(x):
      if((i*2+j*4)==y):
        judge='Yes'
      if((i*4+j*2)==y):
        judge='Yes'
      
    

print(judge)
# Judge status: Wrong Answer
N = int(input())
if N < 999:
  print("ABD")
else:
  print("ABC")
# Judge status: Wrong Answer
n=int(input())
l=list()
if n==1:
  print(0)
else:
  if n%2==0:
    l.append(2)
  if n%3==0:
    l.append(3)
  i=5
  while(i*i<=n):
    if n%i==0:
      l.append(i)
    elif n%(i+2)==0:
      l.append(i+2)
    i+=6
  l.append(n)
  k=0
  for i in l:
    z=i
    while(n%i==0 and n>0):
      n=n//i
      i=i*z
      k+=1
  print(k)
# Judge status: Wrong Answer
import sys
import numpy as np

I = np.array([int(_) for _ in open(0).read().split()])
N, K, Q = I[:3]
ans = I[3:] + K - Q
print(*np.where(ans > 0, 'Yes', 'No')[1:], sep='\n')
# Judge status: Accepted
import math , sys

N , M = list(map(int, input().split()))
H = list(map(int, input().split()))
Es = [[] for _ in range(N)]
for i in range(M):
    A , B = list(map(int, input().split()))
    A -=1 ; B-=1
    Es[A].append(B)
    Es[B].append(A)
ans = 0
for i in range(N):
    Es[i] = list(set(Es[i]))
for i in range(N):
    if len(Es[i]) == 0:
        ans+=1
    else:
        Max = max( [ H[Es[i][j]] for j in range( len(Es[i]) ) ] )
        if H[i] > Max:
            ans+=1
print(ans)
# Judge status: Wrong Answer
abc = list(map(int, input().split()))
if abc.count(5) == 2 and abc.count(7) == 1: print("YES")
else: print("N0")
# Judge status: Wrong Answer
n,m,q = list(map(int,input().split()))
a = [[]]*q
for i in range(q):
    a[i] = list(map(int,input().split()))
ans = 0
def calc(x):
    cnt = 0
    for j in range(q):
        if x[a[j][1]-1] - x[a[j][0]-1] == a[j][2]:
            cnt += a[j][3]
    return cnt
l = [0]*n
for k in range(10*n):
    b = str(k).zfill(n)
    for o in range(n):
        l[o] = int(b[o])
    if ans < calc(l):
        ans = calc(l)
print(ans)
# Judge status: Accepted
D, T, S = map(int,input().split())

t = D / S

if t > T:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
# A - 居合を終え、青い絵を覆う

boin = ('a', 'e', 'i', 'o', 'u')

c = input()

if c in boin:
    print('vowel')
else:
    print('consonant')
# Judge status: Wrong Answer
n = input()
if n in '9':
    print('Yes')
else:
    print('No')
# Judge status: Accepted
A,B=map(int,input().split())
count=0
for i in range(A,B+1) :
  if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[3] :
    count+=1
print(count)
# Judge status: Accepted
N, K = map(int, input().split())
p = list(map(int, input().split()))

p.insert(0, 0)
for i in range(1, N+1):
    p[i] = (p[i] + 1) / 2 + p[i-1]

s = [0] * (N+1)
for i in range(N-K+1):
    s[i] = p[i+K] - p[i]

print(max(s))
# Judge status: Accepted
# ABC166
# B Trick or Treat
N, K = map(int, input().split())
A = [list(map(int, input().split())) for i in range(K*2)]
D = list(A[::2])
del A[::2]
A = sum(A, [])
a = set(A)
OP = [n +1 for n in range(N)]
op = set(OP)
an = op - a
print(len(list(an)))
# Judge status: Wrong Answer
#C
import math
n = int(input())
a=[0]*5
for i in range(5):
    a[i] = int(input())
time = math.ceil(n / a[0])
for i in range(4):
    if a[i] < a[i + 1]:
        a[i + 1] = a[i]
    time += math.ceil(a[i] / a[i + 1])
    print(time)
print(a,time)
# Judge status: Wrong Answer
import itertools
import math
N = int(input())
P = tuple([int(i) for i in input().split()][0:N])
Q = tuple([int(i) for i in input().split()][0:N])
l = list(itertools.permutations(range(1,N+1)))
print(l.index(Q) - l.index(P))
# Judge status: Accepted
A,B,C,K=map(int,input().split())
if A>=K:
  print(K)
elif A+B>=K:
  print(A)
else:
  print(A-(K-A-B))
# Judge status: Wrong Answer
import math

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

kakudo = abs((H*30+0.5*M-M*6)%180) 

if kakudo == 0:
    print(0)
else:
    a = (A**2 + B**2 - 2*A*B*math.cos(math.radians(kakudo)))
    print(math.sqrt(a))
# Judge status: Accepted
import math
a, b = map(int, input().split())

ans = math.ceil((a + b) / 2)

print(ans)
# Judge status: Accepted
n, l = map(int, input().split())


a = []
res = 300
for i in range(n):
  a.append(l+i)
  res = min(res, abs(l+i))
s = sum(a)
if res in a:
  print(s-res)
else:
  print(s+res)
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    x, y = map(int, readline().split())
    if x * y >= 0:
        if x < y:
            print(y - x)
        else:
            print(x - y + 2 if x * y > 0 else x - y + 1)
    else:
        print(abs(abs(x) - abs(y)) + 1)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]

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

sum_a = 0
for a, b in AB:
  sum_a += a
  if sum_a > b:
    print("No")
    exit()
print("Yes")
# Judge status: Wrong Answer
k, x = list(map(int, input().split()))

if 500*k >= x:
    print('yes')
else:
    print('no')
# Judge status: Accepted
n=int(input())
a=[]
j=k=0
def s(a):
    return a[0]+a[1]
def ss(a):
    return a[0]-a[1]
for i in range(n):
    f=list(map(int,input().split()))
    a.append(f)
aa=min(map(s,a))
b=max(map(s,a))
c=min(map(ss,a))
d=max(map(ss,a))
print(max(abs(d-c),abs(b-aa)))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ai = max(a)
a.remove(ai)
aj = a[0]
for i in a:
    if abs(ai/2-i) < abs(ai/2-aj):
        aj = i
print(ai,aj)
# Judge status: Accepted
from functools import lru_cache
 
@lru_cache(maxsize=None)

def ryuka(n):
  if n==0:
    return 2
  elif n==1:
    return 1
  else:
    return ryuka(n-1)+ryuka(n-2)
  
N=int(input())

print(ryuka(N))
# Judge status: Accepted
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7


N = int(readline())
A = list(map(int,readline().split()))
B = list(map(int,readline().split()))
Ka = sum(B)-sum(A)
Kb = Ka
for a,b in zip(A,B):
    if a < b:
        Ka -= (b-a+1)//2
print('Yes' if Ka >= 0 and Kb >= 0 else 'No')
# Judge status: Accepted
import re
N,A,B,C,D = (int(x) for x in input().split())
S = input()
if re.search(r'##',S[A-1:max(C,D)]):
    print('No')
else:
    if D < C:
        if re.search(r'\.\.\.',S[B-2:D+1]):
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')
# Judge status: Accepted
name=list(input().split())

s=name[1][:1]

print('A'+s+'C')
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
r=[0]*9
for a in A:
  for i in range(8,-1,-1):
    if a >= 400*i:
      r[i]+=1
      break
ans=0
for i in range(8):
  if r[i]>0: ans+=1
print(ans, ans+r[8])
# Judge status: Accepted
n = int(input())
ans=[0]*(n+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            a = x * x + y * y + z * z + x * y + y * z + z * x
            if n >= a >= 1:
                ans[a] += 1
print(*ans[1:],sep="\n")
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=list(map(int,input().split()))

hana=[]

for i in a:
  hana.append(i//2)

from fractions import gcd
from functools import reduce
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

mini=lcm_list(hana)

ans=1+((m-mini)//(2*mini))

print(ans)
# Judge status: Accepted
N = int(input())
V = sorted(list(map(int,input().split())))



for i in range(N-1):
    V[0] = (V[0] + V.pop(1))/2
    V = sorted(V)

print(V[0])
# Judge status: Wrong Answer
N = int(input())

print(sum(filter(lambda x : (x%3 != 0) and (x%5 !=0), range(N))))
# Judge status: Accepted
a,b = map(int, input().split())
g_1 =[1,3,5,7,8,10,12]
g_2 = [4,6,9,11]
if (a in g_1 and b in g_1) or (a in g_2 and b in g_2) or (a == 2 and b == 2):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a, b, c, x, y = map(int, input().split())
k = min(x, y)
ans = 0
if a + b >= 2 * c:
  ans += 2 * k * c
  if x >= y:
    ans += min((x - k) * a, 2 * c * (x - k))
  elif x < y:
    ans += min((y - k) * b, 2 * c * (y - k))
else:
  ans += x * a + y * b
print(ans)
# Judge status: Wrong Answer
import copy

n = int(input())
a = [int(input()) for _ in range(n)]
a_down = sorted(a, reverse=True)
for i in range(n):
    a_down_copy = copy.deepcopy(a_down)
    while a[i] == max(a_down_copy):
        if max(a_down_copy) == min(a_down_copy):
            break
        a_down_copy.pop(0)
    print(max(a_down_copy))
# Judge status: Accepted
N,K=map(int,input().split())
if N%K==0:
  print(0)
else:
  print(N//K+1-N//K)
# Judge status: Accepted
N = int(input())
S = input()

A = [0]*N
B = [0]*N

for i in range(1, N):
    A[i] = A[i-1] + (1 if S[i-1]=='W' else 0)
    B[N-i-1] = B[N-i] + (1 if S[N-i]=='E' else 0)

print(min(map(lambda x: x[0]+x[1], zip(A, B))))
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))
dp = [10**7]*n
dp[0] = 0
for i in range(1,n):
  dp[i] = min([dp[i-j]+abs(h[i]-h[i-j]) for j in range(1,min(3,i+1))])
print(dp[n-1])
# Judge status: Accepted
s = input()
l = len(s)
x = s[l-1]
if x == "s":
    print(s + "es")
else:
    print(s + "s")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ans = 0
ans += b[a[0]-1] 
for i in range(1,n):
    ans += b[a[i]-1]
    if a[i-1]+1 ==  a[i]:
        ans += c[a[i]-2]

print(ans)
# Judge status: Accepted
a, b = map(int, input().split())

cnt = 0
for i in range(a, b+1):
  r = ''.join(list(reversed(str(i))))
  if i == int(r):
    cnt += 1
    
print(cnt)
# Judge status: Accepted
import sys


def main():
    S = sys.stdin.readline().rstrip()

    if len(S) % 2 == 0:
        S = S[:-2]
    else:
        S = S[:-1]

    while S:
        if S[: len(S) // 2] == S[len(S) // 2 :]:
            break
        else:
            S = S[:-2]

    print(len(S))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
c=list(map(int, input().split()))

if c[0]>=c[2]:
  c[0]-=c[2]
else :
  c[2]-=c[0]
  c[1]-=c[2]
  c[0]=0
print(c[0] , c[1])
# 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])


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)
# Judge status: Accepted
from math import gcd
k=0
n=int(input())
for a in range(1,n+1):
    for b in range(a,n+1):
        for c in range(b,n+1):
            l=list(set([a,b,c]))
            p=1
            for i in range(len(l)-1):
                p*=3-i
            k+=gcd(gcd(a,b),c)*p
print(k)
# Judge status: Wrong Answer
A,B=map(int,input().split())
if max([A,B])>8:
  print(":(")
else:
  print("Yay")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a_small = 0
b_small = 0
for a, b in zip(A,B):
    if a < b:
        a_small += b - a
    else:
        b_small += a - b
if a_small < b_small * 2:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
n = int(input())
s = []
for _ in range(n):
    s.append(int(input()))

ans = sum(s)

s.sort()

for x in s:
    if ans % 10 != 0:
        break
    else:
        ans -= x

print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
P = list(map(int, input().split()))

#期待値L
L = [0 for _ in range(N)]
for i in range(N):
    L[i] = (1+P[i])/2

#累積和S
S = [0 for i in range(N)]
S[0] = L[0]
for i in range(1, N):
    S[i] = S[i-1] + L[i]

total = S[K-1]
for i in range(N-K):
    tmp = S[i+K]-S[i]
    if total < tmp:
        total = tmp

print(total)
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
l=[0]*N
for i in range(N):
    if a[i]%4:
        if a[i]%2:l[i]=1
        else:l[i]=2
    else:l[i]=4
if l.count(2):
    if (l.count(2)+l.count(1)+1)//2<=l.count(4):
        print('Yes')
    else:
        print('No')
else:
    if l.count(1)+1//2<=l.count(4):
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
ans = list(int(i) for i in input().split()) 
ans.sort()

if ans[0]==ans[1] or ans[1] == ans[2]:
    print("Yes") 
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
a=[int(input()) for i in range(5)]
amin=min(a)
a1=int(n/amin+1)+4
print(a1)
# Judge status: Accepted
def main():
    N = int(input())
    sum=1
    for i in range(1,N+1):
        sum*=i
        sum=sum%1000000007 
    print(sum)


    
if __name__ == '__main__':
    main()
# Judge status: Accepted
N,P=map(int,input().split())
A=list(map(int,input().split()))
for i in range(N):
    A[i]%=2

odds=sum(A)
evens=N-odds 
if odds>0:
    ans=2**evens 
    ans*=2**(odds-1)
    print(ans)
else:
    if P==0:
        print(2**evens)
    else:
        print(0)
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())

    neg = total = 0
    min_abs = INF
    for a in A:
        if a < 0:
            neg += 1
        total += abs(a)
        if min_abs > abs(a):
            min_abs = abs(a)

    if neg % 2 == 1:
        total -= 2 * min_abs

    print(total)
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
K, X = map(int, input().split())
for i in range(X-K+1, X+K):
    if i < X+K-1:
        print (i, end=" ")
    else:
        print (i)
# Judge status: Accepted
n=int(input())
def prime_factor(n):
  ass=[]
  for i in range(2,int(n**0.5)+1):
    while n%i==0:ass.append(i);n//=i
  if n!=1:ass.append(n)
  return ass
p=prime_factor(n)
from collections import Counter
c=Counter(p)
ans=0
for i in c:
  m=c[i]
  for j in range(1,10**20):
    if j>m:break
    ans+=1
    m-=j
print(ans)
# Judge status: Accepted
from itertools import accumulate
n = int(input())
A = list(map(int, input().split()))
Acum = list(accumulate(reversed(A)))
Acum.reverse()

flexibility = 1
ans = 0
for i, a in enumerate(A):
    if flexibility < a:
        print(-1)
        exit()
    ans += min(flexibility, Acum[i])
    flexibility = 2*(flexibility-a)

print(ans)
# Judge status: Accepted
a, b, c, d = map(int, input().split())
ans = 0
# 求める秒数は(二つのスイッチのうち先に離された方の時刻) - (二つのスイッチのうち後に押された時刻)となる．
_min = min(b, d)
_max = max(a, c)
ans = _min - _max
if ans < 0:
  print(0)
else:
  print(ans)
# Judge status: Accepted
import math
a,b=map(int, input().split())

if abs(a-b) == 1:
    c = math.factorial(a)%(10**9+7)
    d = math.factorial(b)%(10**9+7)
    print(c*d%(10**9+7))
if abs(a-b) == 0:
    c = math.factorial(a)%(10**9+7)
    d = math.factorial(b)%(10**9+7)
    print(c*d*2%(10**9+7))
if abs(a-b) >= 2:
    print(0)
# Judge status: Accepted
x, y = map(int, input().split())
if y == 0:
    if x <= 0:
        print(abs(x))
    else:
        print(abs(x)+1)
elif x==0:
    if y < 0:
        print(-y+1)
    else:
        print(y)
elif x*y < 0:
    r = []
    x, y = sorted([x, y])
    r.append(abs(y-x))
    r.append(abs(y+x)+1)
    print(min(r))
elif x > y:
    print(abs(y-x)+2)
else:
    print(abs(y-x))
# Judge status: Accepted
N = int(input())
dt, dx, dy = 0, 0, 0
avilable = True
for i in range(N):
    t, x, y = map(int, input().split())
    if abs(x-dx)+abs(y-dy) > t-dt or (abs(x-dx)+abs(y-dy)) % 2 != (t-dt) % 2:
        avilable = False
    dt = t
    dx = x
    dy = y
if avilable:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n,m = map(int,input().split())
m = m//2
print((n+m)//2)
# Judge status: Accepted
N, K = map(int, input().split())
H = [h for h in map(int, input().split())]
H.sort()
if N-K <= 0:
    print(0)
else:
    print(sum(H[:N-K]))
# Judge status: Accepted
s = list(input())
k = int(input())
t = list(map(lambda x:ord(x)-ord("a"),s)) #a-zを0-25に正規化

for i in range(len(t)):
  diff = 26-t[i] #aになるまでの差
  if diff != 26 and diff <= k: 
    t[i]+=diff
    k-=diff
  else:
    continue

t[-1]+=k #k余りを一番最後に足す

u = "".join(list(map(lambda x:chr((x%26+ord("a"))),t)))
print(u)
# Judge status: Accepted
N = int(input())
import math
ans = int(input())
for i in range(N - 1):
    a = int(input())
    ans = a * ans // math.gcd(a, ans)
print(ans)
# Judge status: Accepted
def abc077c_snuke_festival():
    import bisect
    n = int(input())
    a = sorted(list(map(int, input().split())))
    b = sorted(list(map(int, input().split())))
    c = sorted(list(map(int, input().split())))
    total = 0
    for i in range(n):
        b_size = b[i]
        j = bisect.bisect_left(a, b_size)
        j = n - j
        k = bisect.bisect_right(c, b_size)

        total += (n - j) * (n - k)
    print(total)


abc077c_snuke_festival()
# Judge status: Accepted
a,b=map(int,input().split())
print('Draw' if a==b else 'Alice' if (a+13)%15>(b+13)%15 else 'Bob')
# Judge status: Accepted
n = str(input())
num = int(n[-1])

if num in [2, 4, 5, 7, 9]:
    print("hon")
elif num in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")
# Judge status: Wrong Answer
N,K = list(map(int,input().split()))
S = input()
lc = S.count('L')
rc = N-lc
maxc = lc+rc-2
nowc = 0
now = S[0]
for i in range(1,N):
    if S[i] == now:
        nowc += 1
    else:
        now = S[i]
print(min(nowc+2*K,maxc))
# Judge status: Accepted
import sys
from collections import deque

K = int(sys.stdin.readline())

q = deque()
for i in range(1, 10):
    q.append(i)

#count = 0
#while count <= K:
for _ in range(K):
    n = q.popleft()
    #count += 1
    if n % 10 != 0:
        q.append(n*10 + n % 10 - 1)
    q.append(n*10 + n % 10)
    if n % 10 != 9:
        q.append(n*10 + n % 10 + 1)
print(n)
# Judge status: Accepted
#!/usr/bin/env python3
s = input()
k = int(input())
ans = ""
n = len(s)
for p, i in enumerate(s):
    if p == n - 1:
        ans += chr((ord(i) - 97 + k) % 26 + 97)
        break
    if (cost := (123 - ord(i)) % 26) <= k:
        ans += "a"
        k -= cost
    else:
        ans += i
print(ans)
# Judge status: Accepted
n = int(input())
ll = [0]*(n+1)
l = list(map(int,input().split()))
for i in l:
  ll[i]+=1
for i in range(n):
  print(ll[i+1])
# Judge status: Wrong Answer
from fractions import gcd

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

gcd_left, gcd_right = [0] * N, [0] * N
gcd_left[0] = A[0]
gcd_right[-1] = A[-1]
for i in range(1, N):
    gcd_left[i] = gcd(gcd_left[i - 1], A[i])
for i in range(N - 2, -1, -1):
    gcd_right[i] = gcd(gcd_right[i + 1], A[i])

gcd_left = [gcd_right[-1]] + gcd_left
gcd_right = gcd_right + [gcd_left[0]]
ans = 1
for i in range(N):
    ans = max(ans, gcd(gcd_left[i], gcd_right[i + 1]))
print(ans)
# Judge status: Accepted
S=input()
ans0=0
ans1=0
for i in range(len(S)):
    s=int(S[i])
    if i%2==0:
        if s==1:
            ans0+=1
        else:
            ans1+=1
    else:
        if s==0:
            ans0+=1
        else:
            ans1+=1
print(min(ans0,ans1))
# Judge status: Accepted
import sys

N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

if X <= Y:
	Z = list(range(X+1,Y+1))
else:
	print('War')
	sys.exit()

Z_x = max(x)+1
Z_y = min(y)
if Z_x <= Z_y:
	Z_xy = list(range(Z_x,Z_y+1))
else:
	print('War')
	sys.exit()

for i in Z_xy:
	if i in Z:
		print('No War')
		sys.exit()
print('War')
# Judge status: Accepted
N, A, B = map(int,input().split())
count = 0
for i in range(N):
    s = str(i+1)
    array = list(map(int,s))
    kei = sum(array)
    if A <= kei <= B:
        count += i+1
print(count)
# Judge status: Accepted
k,x = map(int,input().split())
a = 500*k
if a >= x:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
L = list(map(int, input().split()))
L.sort()
print(L[0] + L[1])
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
n=int(input())
l=[a*4,b*2,c,d/2]
p=min(l)
q=min(l[:3])
print(int(n*min(l)) if n%2==0 or p==q else int((n-1)*(d/2)+q))
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
x = int(input())
d = 0
for i in range(a):
    for j in range(b):
        for k in range(c):
            if i*500+j*100+k*50==x:
                d +=1
print(d)
# Judge status: Wrong Answer
n = int(input())
P = list(map(int, input().split()))

ans = 0
for i in range(n-1):
    if i+1 == P[i]:
        P[i], P[i+1] = P[i+1], P[i]
        ans+=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
x, y, xy = [], [], []
for i in range(n):
	temp_x, temp_y = map(int, input().split())
	x.append(temp_x)
	y.append(temp_y)
	xy.append(temp_x * temp_y)
max_index, min_index = xy.index(max(xy)), xy.index(min(xy))
print(abs(x[max_index] - x[min_index]) + abs(y[max_index] - y[min_index]))
# Judge status: Wrong Answer
S=str(bin(int(input())))
if S[0]=="-":
    print(S[3:])
else:
    print(S[2:])
# Judge status: Wrong Answer
x, y = map(int, input().split())
dp = [[0]*(y+1) for _ in range(x+1)]

for i in range(1, x+1):
    w, v = map(int, input().split())
    for j in range(w, y+1):
        num0 = dp[i-1][j]
        num1 = dp[i-1][j-w]+v
        if num1 > num0:
            dp[i][j] = num1
        else:
            dp[i][j] = num0
print(max(dp[-1]))
# Judge status: Accepted
s = sorted(input())
t = sorted(input(), reverse=True)

for item in zip(s,t):
    if ord(item[0]) < ord(item[1]):
        print('Yes')
        exit()
    elif ord(item[0]) > ord(item[1]):
        print('No')
        exit()
if len(s) < len(t):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
d = list(map(int, input().split()))
d = sorted(d)
tar = int(n/2) - 1


left = d[tar]
right = d[tar + 1]
print(left, right)
diff = right - left
if (diff == 0):
    ans = 0
else:
    ans = diff

print(ans)
# Judge status: Accepted
n,m = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(n)]
c = [list(map(int,input().split())) for _ in range(m)]


ans = [0] * n
for i in range(n):
    tmp = [0, 10 ** 18]
    for j in range(m):
        if abs(a[i][0]-c[j][0])+abs(a[i][1]-c[j][1]) < tmp[1]:
            tmp = [j,abs(a[i][0]-c[j][0])+abs(a[i][1]-c[j][1])]
    ans[i] = tmp[0]+1

for i in ans:
    print(i)
# Judge status: Wrong Answer
n=int(input())
s=sorted([input() for k in range(n)])
s3 = sorted(list(set(s)))
if(len(set(s))==len(s)):
    for u in range(len(s)):
        print(s[u])
    exit()
else:
    s1=s2 = [m for m in s3 if s.count(m)>1]
    i = (len(s)-len(s1))//2
    while(len(s2)!=0):
        s2 = [m for m in s3 if s.count(m)>i]
        if(len(s2)==0):
               break
        s1 = s2
        i+=1
for j in s1:
    print(j)
# Judge status: Wrong Answer
n = int(input())
a = [0] * n
b = [0] * n
sa = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())
    sa[i] = b[i] - a[i]
so = sa
sa.sort()
wa = 0
for i in sa:
    wa += a[so.index(i)]
    if wa > b[so.index(i)]:
        print("No")
        exit()
print("Yes")