peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
P = list(map(int, input().split()))

cnt = 0
for i in range(1, n - 1):
    f = 0
    if P[i - 1] < P[i] and P[i] < P[i + 1]:
        f = 1
    elif P[i -1] > P[i] and P[i] > P[i + 1]:
        f = 1
    if f == 1:
        cnt += 1

print(cnt)
# Judge status: Accepted
X = int(input())
ans = 1
for i in range(2,X):
    j = 2
    if i**j > X:
        continue
    while i**j <= X:
        j+=1
    ans = max(ans,i**(j-1))
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse = True)
min = 0

for i in range(K):
  min += A[i]
  
print(min)
# Judge status: Accepted
N = int(input())
if N%2==0:
  print(1/2)
else:
  print((((N-1)/2)+1)/N)
# Judge status: Accepted
n = int(input())
cnt = 0
for a in range(1, n):
    for b in range(1, ((n-1)//a)+1):
        c = n - a*b
        if c <= 0: break
        cnt += 1
print(cnt)
# Judge status: Accepted
s=input()
x=len(s) // 2
a=x*'hi'
if a == s:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
def main():
    K, A, B = (int(i) for i in input().split())
    ans = 1
    K -= (A-ans)
    ans = A
    if B-A > 2:
        ans += (B-A)*(K // 2)
        if K & 1:
            ans += 1
    else:
        ans += 1*K
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N = int(input())
for i in range(20):
  if(N < 1000):
    break
  N -= 1000
print(str(1000-N))
# Judge status: Accepted
A,B,C = map(int, input().split())
if A%2==0 or B%2==0 or C%2==0:
    print(0)
else:
    li = sorted([A,B,C])
    print(li[0] * li[1])
# Judge status: Accepted
n = int(input())
s = input()
a = []
a.append(0)

for i in range(n):
    if s[i] == 'I':
        a.append(a[i]+1)
    else:
        a.append(a[i]-1)
print(max(a))
# Judge status: Accepted
n=int(input())

p=list(map(int, input().split()))
pm=max(p)
p.remove(pm)
if pm<sum(p):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
A,V = list(map(int, input().split()))
B,W = list(map(int, input().split()))
T = int(input())
print("YES" if (V-W) * T >= abs(B-A) else "NO")
# Judge status: Accepted
import sys
readline = sys.stdin.readline

def main():
    N = int(readline())
    A1 = list(map(int, readline().rstrip().split()))
    A2 = list(map(int, readline().rstrip().split()))
    dp = [[0, 0]  for _ in range(N)]
    dp[0][0] = A1[0]
    dp[0][1] = A1[0] + A2[0]
    for i in range(1, N):
        dp[i][0] = dp[i-1][0] + A1[i]
        dp[i][1] = max(dp[i-1][1], dp[i][0]) + A2[i]

    print(dp[N-1][1])

if __name__ == '__main__':
    main()
# Judge status: Accepted
A, B, C = map(int, input().split())
print("Yes" if A <= C <= B else "No")
# Judge status: Accepted
x,y = map(int,input().split())
print(x+(y//2))
# Judge status: Accepted
a,b,k = map(int,input().split())
if a >= k:
  print(a-k,b)
elif a+b >= k:
  print(0,a+b-k)
else:
  print(0,0)
# Judge status: Accepted
from fractions import gcd
def lcm(x,y):
  return (x*y) // gcd(x,y)
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
l = a[0]
for i in range(1,n):
  l = lcm(l,a[i])
ans = 0
for i in range(n):
  ans += l//a[i]
print(ans%mod)
# Judge status: Accepted
S = input()
l = []
l.append(S.count("a"))
l.append(S.count("b"))
l.append(S.count("c"))
if max(l) - min(l) > 1:
  print("NO")
else:
  print("YES")
# Judge status: Accepted
[N,K,S] = list(map(int,input().split()))
cnt = 0
if S != 1:
    output = []
    for i in range(K):
        output.append(S)
    for i in range(N-K):
        cnt += 1
        if cnt < S:
            output.append(1)
        else:
            output.append(S+1)
            cnt = 0
else:
    output = []
    for i in range(K):
        output.append(S)
    for i in range(N-K):
        output.append(2)

print(" ".join(map(str, output)))
# Judge status: Wrong Answer
h, w = map(int, input().split())
first = int(w/2) + 1
second = int((w-1)/2)

if h % 2 != 0:
  odd_row = first * (int(h/2) + 1)
else: 
  odd_row = first * int(h/2)

even_row = second * int(h/2)

print(odd_row + even_row)
# Judge status: Accepted
s = input()
n,m = 0,0
for i in range(len(s)):
    if i%2==0 and s[i]=='0': n+=1
    if i%2==1 and s[i]=='1': n+=1
for i in range(len(s)):
    if i%2==0 and s[i]=='1': m+=1
    if i%2==1 and s[i]=='0': m+=1
print(min(n,m))
# Judge status: Accepted
a,b,c=map(int,input().split())
print(len(set([a,b,c])))
# Judge status: Accepted
A,B,C = map(int,input().split())
print(A*B//2)
# Judge status: Wrong Answer
#C - Repsept
K = input()
K = int(K)

def each_sum(n):#各桁の合計を求める
    s = str(n)
    allay = list(map(int,s))#文字列sを数値リストにして返す
    return(sum(allay)) 
def seven():
    seven_i = 0
    count = 0
    for i in range(1,K):
        seven_i = (7 * ((10**i) -1 )  // 9)
        seven_i %= K
        count += 1
        if seven_i % K == 0:
            return count
    return -1

print(seven())
# Judge status: Accepted
S = input()

if S == 'Sunny':
  print('Cloudy')
elif S == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
# Judge status: Accepted
import sys
input = sys.stdin.readline
# int(input()) # 入力が1つ
a, b, c = map(int, input().split()) # 入力が複数
nums = sorted([a, b, c])

ans = 0
if (nums[1] - nums[0]) % 2 != 0:
    nums[2] += 1
    nums[1] += 1
    ans += 1
ans += (nums[1] - nums[0]) // 2
ans += nums[2] - nums[1]
print(ans)
# Judge status: Accepted
import math
a,b=input().split(" ")
n = math.sqrt(int(a+b))
if n.is_integer():
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
for i in range(n):
  if a[i]>=b[i]:
    ans+=b[i]
  else:
    res=b[i]-a[i]
    if a[i+1]-res<0:
      ans+=a[i]+a[i+1]
      a[i+1]=0
    else:
      ans+=b[i]
      a[i+1]-=res
print(ans)
# Judge status: Accepted
c = input()
c1 = input()

if c == c1[::-1]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n = int(input())
A = input().split()
for i in range(n-1):
    A[i] = int(A[i])

l = [0] * n

for i in range(n-1):
    l[A[i]-1] += 1
for i in range(n):
    print(l[i])
# Judge status: Accepted
s = "abcdefghijklmnopqrstuvwxyz"
print(s[s.index(input())+1])
# Judge status: Accepted
def main():
    n, k = map(int, input().split())
    s = list(input())

    s[k-1] = s[k-1].lower()

    print(''.join(s))

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
a = sorted(map(int,input().split()))
b = []
for i in range(n-1):
    c = a[i+1]-a[i]
    if c >= 0:
        b.append(c)
print(sum(b))
# Judge status: Accepted
n = int(input())
li = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i > 0:
        if  li[i-1] > li[i]:
            ans += li[i-1]-li[i]
            li[i] += (li[i-1]-li[i])

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

if (b - a) % 2 == 0:
  print(b - (a+b)//2)
else:
  if (a - 1) > (n - b):
    print((n-b) + 1 + (b-a-1)//2)
  else:
    print((a-1) + 1 + (b-a-1)//2)
# Judge status: Accepted
import math
x = int(input())
b = 0

"""
def calc(b, b5):
    a = (x+b5)**0.2

    if a.real.is_integer():
        print(int(a), b)
        exit()

while True:
    b5 = b ** 5
    calc(b, b5)
    if x-b5 >= 0:
        calc(-b, -b5)
    b += 1
    """

for i in range(-120,120):
    for j in range(-120,120):
        if i**5 - j**5 == x:
            print(i, j)
            exit()
# Judge status: Accepted
import sys
H, W = list(map(int, input().split()))


if H == 1:
    print(1)
    sys.exit(0)
if W == 1:
    print(1)
    sys.exit(0)

if W % 2 == 0:
    kisu = W // 2
    gusu = W // 2
else:
    kisu = W // 2 + 1
    gusu = W // 2

if H % 2 == 0:
    ans = (kisu + gusu) * (H // 2)
else:
    ans = (kisu + gusu) * (H // 2) + kisu

print(ans)
# Judge status: Accepted
# 整数の入力
N = int(input())
 
print((10 ** N - 2* 9 ** N + 8 ** N) % (10 ** 9 + 7))
# Judge status: Accepted
S, T = map(str, input().split())
print(T + S)
# Judge status: Accepted
S=input()
T=input()
for i in range(len(S)):
  if S==T:
    print("Yes")
    exit()
  temp=S[-1]
  S=temp+S[0:(len(S)-1)]
print("No")
# Judge status: Accepted
import sys
N, H = map(int, input().split())
a = []
b = []
for i in range(N):
    s, t = map(int, input().split())
    a.append(s)
    b.append(t)
A = max(a)
b.sort(reverse=True)
num = 0
ans = 0
for x in b:
    if A < x:
        num += x
        ans += 1
        if num >= H:
            print(ans)
            sys.exit()
    else:
        break
if (H-num)%A == 0:
    ans += (H - num) // A
else:
    ans += (H - num) // A + 1
print(ans)
# Judge status: Accepted
import math
print(math.ceil(int(input()) / 2))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

cnt = [0 for _ in range(100005)]
for a in A:
    cnt[a] += 1

ans = 0
for i in range(1, len(cnt) - 1):
    ans = max(ans, cnt[i - 1] + cnt[i] + cnt[i + 1])

print(ans)
# Judge status: Wrong Answer
n, m = input().split()
n = m*int(n)
m = n*int(m)
print(min(int(n), int(m)))
# Judge status: Accepted
from collections import deque

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

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

print('Yes')

q = deque()
d = [-1] * N
d[0] = 0
q.append(0)

while q:
    x = q.popleft()
    for i in route[x]:
        if d[i] == -1:
            d[i] = x + 1
            q.append(i)

for i in range(1, N):
    print(d[i])
# Judge status: Accepted
X, Y = map(int, input().split())

p = list(range(X*2,X*4+1,2))
b = Y

if b in p:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
int_list = list(map(int,(input().split())))
count = 0
for i in range(30):
    for i in range(len(int_list)):
        
        if int_list[i] % 2 == 0 :
            int_list[i] = int_list[i]/2
        else:
            int_list = []
            break      
    if len(int_list) == n :
        count += 1
    else: 
        break
print(count)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
DP=[[1000,1000,0] for i in range(N+1)]
for i in range(N):
  DP[i+1][0]=max(DP[i][0],DP[i][1]+DP[i][2]*A[i])
  DP[i+1][1]=DP[i+1][0]%A[i]
  DP[i+1][2]=DP[i+1][0]//A[i]
print(DP[N][0])
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

ab = int((a*b)**0.5)

if a+b+2*ab<c:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from collections import deque
s=input()

d=deque()
for i in range(len(s)):
    if s[i]=="1":
        d.append("1")
    elif s[i]=="0":
        d.append("0")
    else:
        if len(d)!=0:
            d.pop()

L="".join(d)
print(L)
# Judge status: Accepted
a,b,c = [int(i) for i in input().split()]
k = int(input())
count = 0
while a >= b:
  b = b*2
  count += 1
while b >= c:
  c = c*2
  count += 1
if count > k:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
n,a,b = map(int,input().split())

def comb(n,r,mod=10**9+7):
    a=1
    b=1
    r = min(r,n-r)
    for i in range(r):
        a = a*(n-i)%mod
        b = b*(i+1)%mod
    return a*pow(b,mod-2,mod)%mod

ans = pow(2,n,10**9+7)-1 - comb(n,a) - comb(n,b)
ans %= 10**9+7
print(ans)
# Judge status: Wrong Answer
A = map(int, input().split())

if sum(A) > 22:
    print("bust")
else:
    print("win")
# Judge status: Wrong Answer
A=list(input().split())
A=sorted(A)
b=A[0]+A[1]
print(int(b)+int(A[2]))
# Judge status: Wrong Answer
n = int(input())
s = list(input())
count_1 = 0
for i in range(n-1):
    if s[i] == "#" and s[i+1] == ".":
        count_1 += 1
count_2 = 0
for i in reversed(range(n-1)):
    if s[i] == "#" and s[i+1] == ".":
        count_2 += 1
print(min(count_1,count_2))
# Judge status: Accepted
a,b,m = [int(x) for x in input().split()]
lia = [int(x) for x in input().split()]
lib = [int(x) for x in input().split()]
wari = list()
for _ in range(m):
    wari.append([int(x) for x in input().split()])
ans = 10**20
for i in wari:
    s = lia[i[0]-1]+lib[i[1]-1]-i[2]
    ans = min(ans,s)
x = min(lia)+min(lib)
ans = min(ans,x)
print(ans)
# Judge status: Accepted
C=str(input())
V="aiueo"
if C in V:
    ans="vowel"
else:
    ans="consonant"
print(ans)
# Judge status: Accepted
H, N = map(int, input().split())
A = list(map(int, input().split()))
if H > sum(A):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
def gcd(x,y):
    if y==0:
        return x
    return gcd(y,x%y)

MOD = 10**9+7
N = int(input())
A = list(map(int,input().split()))
lcm = 1
for i in A:
    lcm = (lcm*i)//gcd(lcm,i)
lcm %= MOD
ans = 0
for i in A:
    ans += lcm*pow(i,MOD-2,MOD)

print(ans%MOD)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()
import bisect

def cumsum(a):
   r = [0]
   for v in a:
      r.append(r[-1] + v)
   return r

n, m, k = map(int, input().split())
a = cumsum(list(map(int, input().split())))
b = cumsum(list(map(int, input().split())))

ans = 0
for a_num, v in enumerate(a):
   tmp = 0
   if k >= v:
      b_num = bisect.bisect_right(b, k - v) - 1
      tmp = a_num + b_num
   ans = max(ans, tmp)
print(ans)
# Judge status: Accepted
def sum_digit(num):
    sums = 0
    while num != 0:
        sums += num % 10
        num //= 10
    return sums

n = int(input())
min_ans = 9 * 4
for i in range(1, n):
    ans = sum_digit(i) + sum_digit(n - i)
    if min_ans > ans:
        min_ans = ans
print(min_ans)
# Judge status: Accepted
s=input()
m=int(s[:2])
n=int(s[2:])
flag1=1<=m and m<=12
flag2=1<=n and n<=12
if flag1 and flag2 : print("AMBIGUOUS")
elif flag1 : print("MMYY")
elif flag2 : print("YYMM")
else : print("NA")
# Judge status: Accepted
#!/usr/bin/env python3
n,k = map(int,input().split())
ans = 1
while True:
    if n >= k**ans: ans += 1
    else: break
print(ans)
# Judge status: Accepted
def resolve():
    s = int(input())
    ans = [s]
    count = 0
    while True:
        if ans[count]%2 == 0:
            ans.append(ans[count]//2)
        else:
            ans.append(ans[count]*3+1)
        count += 1
        for i in range(count):
            if ans[i] == ans[count]:
                print(count+1)
                exit()
resolve()
# Judge status: Accepted
n,m = map(int,input().split())
P = [list(map(int,input().split())) for _ in range(n)]
C = [list(map(int,input().split())) for _ in range(m)]

for i in range(n):
  d = 10**18
  t = 0
  for j in range(m):
    dist = abs(P[i][0]-C[j][0]) + abs(P[i][1]-C[j][1])
    if d > dist:
      t = j
      d = dist
  print(t+1)
# Judge status: Wrong Answer
towers = {}
h = 0
for i in range(1,1000):
    h += i 
    towers[h] = True 

a,b = map(int,input().split())
snow = 1
while(1):
    if a + snow in towers.keys() and b + snow in towers.keys():
        print(snow)
        break
    snow += 1
# Judge status: Accepted
import math
 
r=int(input())
print(2*r*math.pi)
# Judge status: Accepted
D, T, S = map(int, input().split())

if D / S <= T: print('Yes')
else: print('No')
# Judge status: Accepted
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h.sort()
if k > 0:
    h = h[:-k]
print(sum(h))
# Judge status: Accepted
N = int(input())

work = sorted([list(map(int,input().split())) for i in range(N)], key = lambda x: x[1])
dead = [w[1] - w[0] for w in work]

now = 0

for i in range(N):
  if now > dead[i]:
    ans = "No"
    break
  now += work[i][0]
else:
  ans = "Yes"

print(ans)
# Judge status: Accepted
def main():
    colors = list(map(str, input().split(" ")))
    nums = list(map(int, input().split(" ")))
    trash = input()
    
    nums[colors.index(trash)] -= 1
    print(' '.join(map(str, nums)))

main()
# Judge status: Accepted
from sys import stdin,stdout

def main():
    line=stdin.readline()
    parts=line.split()
    a=int(parts[0])
    b=800*a
    c=int(a/15)*200
    stdout.write(str(int(b-c)))
main()
# Judge status: Accepted
n,m = map(int,input().split())

if n%2 != 0:
  for i in range(m):
    print(1+i,n-i)
else:
  for i in range(m):
    if (n-i)-(1+i) > n/2:
      print(1+i,n-i)
    else:
      print(1+i,n-i-1)
# Judge status: Accepted
import math
if __name__ == '__main__':
    a, b, n = map(int, input().split())
    print(math.floor(a * min(n, b - 1) / b))
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

ans = 0

for i in range(N):
    if i % 2 == 1:
        continue
    if a[i] % 2 == 1:
        ans += 1

print(ans)
# Judge status: Accepted
n = int(input())
for i in range(int(n ** 0.5), 0, -1):
    if n % i == 0:
        print(n // i + i - 2)
        exit()
# Judge status: Accepted
s = input()
if s == 'RRR':
    print('3')
elif s == 'RRS' or s == 'SRR':
    print('2')
elif s == 'SSS':
    print('0')
else:
    print('1')
# Judge status: Wrong Answer
sa = str(input())
sb = str(input())
sc = str(input())
sa_count = 0
sb_count = 0
sc_count = 0
lst = [sa,sb,sc]
count = [sa_count,sb_count,sc_count]
k = 0
abc = 'abc'
flag = False

for _ in range(len(sa)+len(sb)+len(sc)):
    for i in range(3):
        if lst[k][count[k]]==abc[i]:
            count[i] += 1
            k = i
            if len(lst[k])==count[k]:
                flag = True
                break
    if flag:
        break

print(abc[k].upper())
# Judge status: Accepted
N = int(input())

keta = 1
now_26 = 26
while N > now_26:
  keta += 1
  now_26 += 26 ** keta

num = N - int(now_26 - 26 ** keta) -1

answer = ""
for i in range(keta):
  answer += chr(97 + num % 26)
  num = num // 26

print(answer[::-1])
# Judge status: Accepted
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)

A,B,C,D = map(int,input().split())
all_count = B-A+1
c_count = B//C - (A-1)//C
d_count = B//D - (A-1)//D
cd_count = B//lcm(C,D) - (A-1)//lcm(C,D)
ans = all_count - c_count - d_count + cd_count
print(ans)
# Judge status: Accepted
from collections import Counter

MOD = 10**9+7

N = int(input())
s = input()
d = Counter(s)
res = 1
for value in d.values():
  res *= value + 1
  res %= MOD
res -= 1
print(res)
# Judge status: Accepted
#方法２
import math
n = int(input())

if math.floor(math.ceil(n/1.08) * 1.08) == n:
    print(math.ceil(n/1.08))
else:
    print(':(')
# Judge status: Wrong Answer
N, K, Q=map(int, input().split())
A=[None]*Q
for i in range(Q):
    A[i]=int(input())

#print(N,K,Q,A)

score=[K]*N

for answer in A:
    score=[point-1 for point in score]
    score[answer-1]+=1
    #print(score)

for point in score:
    if point>=0:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
import math
s = list(map(int, input().split()))
print(str(math.ceil(s[0] / s[1])))
# Judge status: Accepted
N = int(input())
S = input()

max_common_char = 0
for idx in range(N):
    p, v = S[:idx], S[idx:]
    commons = len(set(list(p)) & set(list(v)))
    if max_common_char <= commons:
        max_common_char = commons
print(max_common_char)
# Judge status: Wrong Answer
D,T,S=map(int,input().split())

if T*S >= D:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

a.sort(reverse=True)
ans = 0
for i in range(n):
    if i % 2 == 0:
        ans += a[i]
    else:
        ans -= a[i]
print(ans)
# Judge status: Wrong Answer
S = str(input())

if S.count("N") == S.count("S") and S.count("W") == S.count("E"):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import math
N, D = map(int, input().split())
print(math.ceil(N / (2 * D + 1)))
# Judge status: Accepted
n = int(input())
if n == 3 or n == 5 or n == 7:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
s = int(input())

x1, y1 = 0, 0
x2 = 10**9
y2 = 1
y3 = -(-s // 10**9)
x3 = abs(x2 * y3 - s)

print(x1, y1, x2, y2, x3, y3)
# Judge status: Accepted
def main():
    N, R = map(int, input().split())
    if N >= 10:
        print(R)
    else:
        print(R+100*(10-N))
if __name__ == "__main__":
    main()
# Judge status: Accepted
N,K=list(map(int,input().split()))
print(min(N%K,K-N%K))
# Judge status: Accepted
a, b= map(int, input().split())
if ((a<0)and(b<0))and((abs(a)+abs(b))%2==0):
    print('Negative')
elif (a>0)and(b>0):
    print('Positive')
elif ((a<0)and(b<0))and((abs(a)+abs(b))%2==1):
    print('Positive')
elif (a==0)or(b==0):
    print('Zero')
else:
    print('Zero')
# Judge status: Accepted
from collections import Counter

w=input()

d=Counter(w)

ans="Yes"
for i in d.values():
  if i%2!=0:
    ans="No"
    break

print(ans)
# Judge status: Wrong Answer
S = input()
if (S == 'SSS'):
  print(0)
if (S == 'SSR'):
  print(1)
if (S == 'SRS'):
  print(1)
if (S == 'SRR'):
	print(2)
if (S == 'RSS'):
  print(1)
if (S == 'RSR'):
  print(2)
if (S == 'RRS'):
  print(2)
if (S == 'RRR'):
	print(3)
# Judge status: Accepted
def inpl(): return list(map(int, input().split()))
S = input()
ok = False
if S[0] == "A" and S[2:-1].count("C") == 1:
    u = 0
    for s in S[1:]:
        u += s.isupper()
    if u == 1:
        ok = True
if (ok):
    print("AC")
else:
    print("WA")
# Judge status: Accepted
def main():
	x, y = map(int , input().split())
	cnt = 0
	while x<=y:
		x = x*2
		cnt = cnt+1
	print(cnt)
if __name__=="__main__":
	main()
# Judge status: Wrong Answer
N,M = map(int,(input().split()))
if N >= 2*M:
    print(M)
else:   
    print(N + (M-N*2)//4)
# Judge status: Accepted
n = int(input())
rule = []
w = input()
rule.append(w)
now = w[-1]
for i in range(n - 1):
    w = input()
    if w in rule:
        print("No")
        exit()
    elif now != w[0]:
        print("No")
        exit()
    else:
        rule.append(w)
        now = w[-1]
print("Yes")
# Judge status: Accepted
A, B, C = map(int, input().split())
if A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
  ans = 0
else:
  ans = min(A*B, min(B*C, C*A))
print(ans)
# Judge status: Accepted
import math
N=int(input())
sum=0
for I in range(1,N+1):
    sum= sum+ I
print(sum)
# Judge status: Wrong Answer
def main():
    from math import ceil
    from itertools import accumulate
    from bisect import bisect
    n, h, *ab = map(int, open(0).read().split())
    x = max(ab[::2])
    *y, = filter(lambda i: i >= x, ab[1::2])
    y.sort(reverse=True)
    *z, = accumulate(y)
    if z[-1] <= h:
        print(len(y) + ceil((h - z[-1]) / x))
    else:
        print(bisect(y, h))


if __name__ == '__main__':
    main()
# Judge status: Accepted
from collections import defaultdict
n = int(input())
d = defaultdict(int)
for i in range(1, n+1):
    if str(i)[-1] == '0':
        continue
    d[int(str(i)[0] + str(i)[-1])] += 1
ans = 0
for i in range(11, 100):
    ans += d[i] * d[int(str(i)[1] + str(i)[0])]
print(ans)
# Judge status: Wrong Answer
"""
author : halo2halo
date : 8, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

word = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(readline())
S = readline().decode('utf8').rstrip()
print(S)

ans = [None] * len(S)
print(ans)
print(len(S))
for i in range(len(S)):
    # print(word[(word.index(S[i]) + N) % len(word)])
    ans[i] = word[(word.index(S[i]) + N) % len(word)]

ans=''.join(ans)
print(ans)
# Judge status: Accepted
x,y=map(int,input().split())
if y%2==0 and y//2-x>=0 and 2*x-y//2>=0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a,b=map(int,input().split())
if a<9>b: print('Yay!')
else: print(':(')
# Judge status: Accepted
N = int(input())
nums = [int(input()) for i in range(N)]
sorted_nums = sorted(nums)

max_num = sorted_nums[-1]
second_max_num = sorted_nums[-2]

for num in nums:
    if num != max_num:
        print(max_num)
    else:
        print(second_max_num)
# Judge status: Accepted
x,y,z=map(int,input().split())
x-=z
print(x//(z+y))
# Judge status: Accepted
a, v = list(map(int,input().strip().split()))
b, w = list(map(int,input().strip().split()))
t = int(input())
ansa = a + v * t
ansb = b + w * t
ansa2 = a - v * t
ansb2 = b - w * t
if a < b:
    if ansb <= ansa:
        print("YES")
    else:
        print("NO")
else:
    if ansa2 <= ansb2:
        print("YES")
    else:
        print("NO")
# Judge status: Wrong Answer
x, y = map(int, input().split())
print(x + y / 2)
# Judge status: Wrong Answer
N, K = map(int, input().split())

ans = 0
for i in range(1, N+1):
    k = 0
    while i*2**k <= K:
        k += 1
    ans += (1/N)*(1/2)**k

print(ans)
# Judge status: Accepted
s, t = input().split()
print(t+s)