peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
# input
S = list(input())

# check
length = len(S)
if len == 1:
    print(0)
else:
    bwb = ["0", "1"]
    wbw = ["1", "0"]
    cnt = [0] * 2
    for i in range(length):
        if S[i] == bwb[i % 2]:
            cnt[0] += 1
        if S[i] == wbw[i % 2]:
            cnt[1] += 1

    print(min([cnt]))
# Judge status: Wrong Answer
N = int(input())
S = input()
if N%2 != 0:
  print('No')
else:
  if S[0:N//2] == S[N//2:N]:
    print('Yes')
print('No')
# Judge status: Wrong Answer
x = int(input())
print(1) if x == 1 else print(0)
# Judge status: Accepted
n, m = map(int, input().split())
py = sorted([[i] + list(input().split()) for i in range(m)], key=lambda x: (int(x[1]), int(x[2])))

x = 1
a = 1
ans = []
for i, p, y in py:
    if x != int(p):
        x = int(p)
        a = 1
    
    ans.append([i, p.zfill(6)+str(a).zfill(6)])
    a += 1

for i, v in sorted(ans):
    print(v)
# Judge status: Wrong Answer
n=int(input())

if n%10==9 or n/10==9:
    ans="Yes"
else:
    ans="No"
print(ans)
# Judge status: Accepted
A,B=map(int,input().split())
print('Yay!' if (A<=8 and B<=8) else ':(')
# Judge status: Accepted
# input
X,Y,A,B,C = map(int, input().split())
a_list = [int(i) for i in input().split()]
b_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]
a_list.sort(reverse = True)
b_list.sort(reverse = True)
c_list.sort(reverse = True)

#solve
d_list = a_list[:X] + b_list[:Y] + c_list
d_list.sort(reverse = True)
print(sum(d_list[:X+Y]))
# Judge status: Wrong Answer
n,m=map(int,input().split())

dict = {}
for i in range(m):
    p,s=input().split()
    dict.setdefault(p,[]).append(s)

ac_count=0
wa_count=0
for p,s in dict.items():
    for ans in s:
        if ans=='AC':
            ac_count+=1
            is_ac=True
            break
        else:
            wa_count+=1
print(ac_count, wa_count)
# Judge status: Accepted
from collections import defaultdict


def main():
    N = int(input())
    counter = defaultdict(int)
    for _ in range(N):
        s = ''.join(sorted(input()))
        counter[s] += 1
    answer = 0
    for c in counter.values():
        answer += c * (c - 1) // 2
    print(answer)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a, b, n = map(int, input().split())

if b == 1:
    r = [0]
else:
    i = 0
    r = []
    while b*i-1 <= n:
        r.append(int((a*(b*i-1))/b)-a*int((b*i-1)/b))
        i += 1
print(max(r))
# Judge status: Accepted

sq = set()

i, ii= 0,0
while ii <= 160000:
    sq.add(ii)
    i+=1
    ii = i*i

n, d = map(int,input().split())

X = []
for _ in range(n):
    X.append(tuple(map(int,input().split())))

def d2(x,y):
    ret = 0
    for i in range(len(x)):
        ret += (x[i]-y[i])**2
    return ret

ans = 0
for i in range(n):
    for j in range(i+1,n):
        if d2(X[i],X[j]) in sq:
            ans += 1
    
print(ans)
# Judge status: Accepted
c = input()
string = "abcdefghijklmnopqrstuvwxyz"
string = list(string)
for i in range(len(string)):
    if string[i] == c:
        idx = i
print(string[idx+1])
# Judge status: Wrong Answer
n = int(input())
s = list()

for a in range(n):
    s.append(input())

t = list()
m = int(input())

for a in range(m):
    t.append(input())

kind = list(set(s))
kind_length = len(kind)

counter = dict()
for a in range(kind_length):
    counter[kind[a]] = 0

for a in range(n):
    counter[s[a]] += 1

for a in range(m):
    if t[a] not in counter:
        continue
    counter[t[a]] -= 1

print(max(counter.values()))
# Judge status: Accepted
import sys
input=sys.stdin.readline #文字列入力はするな！！
import heapq
n,m=map(int,input().split())
a=[]
for i in input().split():
    heapq.heappush(a,-int(i))
for i in range(m):
    p=-heapq.heappop(a)
    p=p//2
    heapq.heappush(a,-p)
print(-sum(a))
# Judge status: Accepted
N = int(input())
W = input().split()
W = [int(x) for x in W]

S = sum(W)
Ans = abs(S - 2*W[0])
for i in range(N):
  Ans = min(Ans,abs(S- 2*sum(W[:i+1])))
print(Ans)
# Judge status: Accepted
import itertools
N, M, Q = map(int, input().split())
List = [list(map(int, input().split())) for i in range(Q)]
Max = 0
 
for a in itertools.combinations_with_replacement(range(1, M+1), N):
  A = list(a)
  A.sort()
  point = 0
  for i in range(Q):
    ai = List[i][0]
    bi = List[i][1]
    if ai < 1 or N < ai or bi < 1 or N < bi:
      continue
    if A[bi-1]-A[ai-1] == List[i][2]:
      point += List[i][3]
  if Max < point:
    Max = point
 
print(Max)
# Judge status: Accepted
s = list(str(input()))
t = list(str(input()))

def main():
    cnt = 0
    for i in range(0, len(s)):
        if s[i]!=t[i]:
            cnt+=1
    print(cnt)
    return
main()
# Judge status: Accepted
N = int(input())
S_list = []
min_length = 10000
for _ in range(N):
    st = input()
    S_list.append(st)
    min_length = min(min_length, len(st))
char_list = list("abcdefghijklmnopqrstuvwxyz")
total_counter = {char: 1e4 for char in char_list}
for i in range(N):
    string = S_list[i]
    for char in char_list:
        total_counter[char] = min(total_counter[char], string.count(char))


ans = ""

for char, count in total_counter.items():
    ans += char*count
    
print(ans)
# Judge status: Wrong Answer
A =input()
B =input()
if A==B[::-1]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x = list(map(int, input().split()))
print(x.index(0)+1)
# Judge status: Accepted
S=input()
print(S+'s' if S[-1]!='s' else S+'es')
# Judge status: Wrong Answer
import bisect as bi
import collections as cc
I=lambda:list(map(int,input().split()))
x,=I()
ar=[]
i=1
fl=1

t=bi.bisect_left(ar,x)
for i in range(-100,100):
    for j in range(-100,100):
        if (i**5)-(j**5)==x:
            print(i,j)
            fl=0
            break
    if not fl:
        break
# Judge status: Wrong Answer
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = 0
for i in range(n):
    if d > x:
        print(i)
        exit(0)
    d += l[i]
print(n)
# Judge status: Accepted
def gcd(x,y):
    while y != 0:
        x, y = y, x%y
#        print(x,y)
    return(x)

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

s = a[0]
for i in range(1,n):
    ss = gcd(s,a[i])
    s = s*a[i]//ss

ans = 0
for i in range(n):
    ans += s//a[i]
print(ans%(10**9+7))
# Judge status: Wrong Answer
S,T=input().split()
S+=T
print(S)
# Judge status: Wrong Answer
n,m = map(int,input().split())
drink = dict()
cost = []
ans = 0
for i in range(n):
    ab = [int(i) for i in input().split()]
    cost.append(ab[0])
    if ab[0] in drink:
        drink[ab[0]] = drink[ab[0]] + ab[1]
    else:
        drink[ab[0]] = ab[1]
#ここまで入力
cost.sort()
for i in cost:
    if m <= drink[i]:
        ans += m*i
        break
    else:
        m -= drink[i]
        ans += i * drink[i] 
    
print(ans)
# Judge status: Wrong Answer
o = list(input())
e = list(input())

for a, b in zip(o, e):
    print(a+b, end='')
# Judge status: Accepted
a,b = map(str, input().split())

b1, b2 = map(str, b.split("."))
d = len(b2)

ans = int(a) * int(b1 + b2) // 10**d
print(ans)
# Judge status: Accepted
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

K = int(input())

SUM = 0
for i in range(1,K+1):
    for j in range(i,K+1):
        tmp = math.gcd(i,j)
        for k in range(1,K+1):
            if not i == j:
                SUM += math.gcd(tmp,k) * 2
            else:
                SUM += math.gcd(tmp,k)


print(SUM)
# Judge status: Accepted
import math

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

cond = sum(AS) / (4 * M)
AS = sorted(AS, reverse=True)

origin = AS[0:M]
result = list(filter(lambda a: a >= cond, origin))

if origin == result:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
A,B,C,X,Y=map(int,input().split())

P=X*A+B*Y
if X>=Y:
    Q=C*2*Y+(X-Y)*A
    QQ=X*A+C*2*Y
    L=X*2*C
elif Y>X:
    Q=C*2*Y+(Y-X)*B
    QQ=Y*B+X*2*C
    L=Y*2*C



print(min(P,Q,L,QQ))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

i = (c - (a + b))**2
j = 4 * a * b
if i > j:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
lst = input().split()

print(int(lst[0]) * int(lst[1]))
# Judge status: Accepted
a,b=map(int,input().split())
s=[2,3,4,5,6,7,8,9,10,11,12,13,1]
if s.index(a)==s.index(b):
    print('Draw')
elif s.index(a)>s.index(b):
    print('Alice')
else:
    print('Bob')
# Judge status: Wrong Answer
if sorted(input()) == 'abc':
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N=int(input())
S=list(map(int,input().split()))
ans=0
ans+=S[0]
for i in range(N-2):
  ans+=min(S[i],S[i+1])
ans+=S[-1]
print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
clis = [0]*10**5

for i in range(n):
    a,b = map(int,input().split())
    clis[a-1] += b
cnt = 0    
for i in range(10**5):
    cnt += clis[i]
    if k <= cnt:
        print(i+1)
        break
# Judge status: Wrong Answer
a,b = map(int,input().split())
sumA = 0
count  =0
t = True
while t:
    if sumA<b:
        count +=1
    elif sumA>=b:
        t = False
    sumA += a
print(count)
# Judge status: Wrong Answer
n, m=map(int, input().split())
table=[[0]*50 for i in range(50)]

for i in range(m):
    a, b=map(int, input().split())
    table[b-1][a-1]=b
    table[a-1][b-1]=a

for i in range(50):
    ans=0
    for j in range(50):
        if table[j][i]!=0:
            ans+=1

    if ans!=0:
        print(ans)
# Judge status: Wrong Answer
arr = [int(x) for x in input().split()]
for i,x in enumerate(arr):
    if x == 0:
        print(i)
# Judge status: Accepted
def solve(N,abc):
    dp=[[0]*3 for _ in range(N)]
    dp[0][0]=abc[0][0]
    dp[0][1]=abc[0][1]
    dp[0][2]=abc[0][2]
    for i in range(1,N):
        for j in range(3):
            dp[i][j]=max(dp[i-1][(j+1)%3]+abc[i][j],dp[i-1][(j+2)%3]+abc[i][j])
    return max([dp[N-1][i] for i in range(3)])

N=int(input())
abc=[list(map(int,input().split())) for _ in range(N)]
print(solve(N,abc))
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
l.sort()  
s=(l[0]+l[1])/2
for i in range(2,len(l)):
  s=(s+l[i])/2
print(s)
# Judge status: Wrong Answer
import math

N = int(input())
cnt = 0
root = int(math.sqrt(N))
if root<2:
    z = root+1
else:
    z = root
for a in range(1,z):
    # print(a, (N-1)//a - (a-1))
    cnt += (N-1)//a - (a-1)
if root<2:
    print(cnt*2-root)
else:
    print(cnt*2-(root-1))
# Judge status: Wrong Answer
n,k = map(int,input().split())
r,s,p = map(int,input().split())

T = list(input())

for i in range(n):
    l = T[i]
    if(l == "r"):
        T[i] = p
    if(l == "s"):
        T[i] = r
    if(l == "p"):
        T[i] = s

sm = 0
#print(T)
for i in range(n):
    sm += T[i]
#print(sm)

for i in range(k,n):
    if(T[i-k]==T[i]):
        sm -= T[i]
        T[i] = 0

print(sm)
# Judge status: Accepted
n=int(input())
xl=[]

for i in range(n):
    x,l=list(map(int,input().split()))
    xl.append([x-l,x+l,x])

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

armmax=-10**10
cnt=0
for left,right,x in xl:
    if armmax<=left:
        armmax=right
        cnt+=1

print(cnt)
# Judge status: Wrong Answer
n = int (input())
print (n*(n+1)/2)
# Judge status: Wrong Answer
a = list(map(int, input().split()))
a.sort()

if a[0]+a[1] == a[2] or a[0]==a[1] or a[1]==a[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
#D
X,Y=map(int,input().split())
mod=10**9+7
N=10**6

fact=[1 for i in range(N+1)]
for i in range(1,N):
    fact[i+1]=(fact[i]*(i+1))%mod

def nCk(n,k):
    return fact[n]*pow(fact[n-k]*fact[k],mod-2,mod)

ans=0
if (2*Y-X)%3==0 and (2*X-Y)%3==0 and (2*Y-X)>=0 and (2*X-Y)>=0:
    cntx=(2*Y-X)//3
    cnty=(2*X-Y)//3
    
    ans=nCk(cntx+cnty,cntx)%mod

print(ans)
# Judge status: Wrong Answer
# B - Golden Coins
X = int(input())
ans = 1000*(X%500)
X //= 500
ans += 5*(X%5)
print(ans)
# Judge status: Accepted
import bisect

n = int(input())
l = list(map(int,input().split()))
l.sort()

ans = 0
for i in range(n-2) :
  for j in range(i+1,n-1) :
    index = bisect.bisect_left(l,l[i]+l[j])
    ans += index-1-j

print(ans)
# Judge status: Wrong Answer
K = str(input())
S = str(input())

if len(S) < len(K):
    print(S)

else:
    print(S[0:len(K)]+"...")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
cnt_four = cnt_two = 0

for i in a:
    if i%4 == 0:
        cnt_four += 1
    elif i%4 == 2:
        cnt_two += 1
cnt_odd = len(a) - cnt_four - cnt_two

if cnt_two >= 1:
    cnt_odd += 1

if cnt_four >= cnt_odd - 1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b,c = mi()
if a <= c and c <= b:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n= int(input())
s = input()
a =''
for i in range(len(s)):
   
    a += (chr(ord(s[i])+n))
     
print(a)
# Judge status: Wrong Answer
a,b,k = map(int,input().split())

#a,b,k=8,12,2

c = 0
ans = 0
for i in range(1,max(a,b)+1):
  if(a%i == 0 and b%i == 0):
    c += 1
    print(i)
    if(c == k):
      ans = i
      break

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

def main():
    N, A, B = map(int, input().split())
    syo = N // (A + B)
    amari = N % (A + B)
    print(syo * A + min(amari, A))


if __name__ == "__main__":
    main()
# Judge status: Accepted
s = input()
for i in range(26):
    n = s.count(chr(ord('a')+i))
    if n%2==1:
        print('No')
        break
    if i == 25:
        print('Yes')
# Judge status: Accepted
import itertools
n = int(input())
a = list(itertools.accumulate(list(map(int, input().split()))))
ans = 10000000000000
sum_a = a[-1]
for i in range(n-1):
  ans = min(ans,abs(sum_a - 2 * a[i]))
print(ans)
# Judge status: Accepted
n, c, k = map(int, input().split())
t = sorted([int(input()) for _i in range(n)])+[float('inf')]

b = 0
time = t[0]
count = 0
for i in range(n+1):
    if t[i] > time+k or count == c:
        b += 1
        time = t[i]
        count = 0
    count += 1
print(b)
# Judge status: Accepted
X = int(input())
if X in [7, 5, 3]:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
n = int(input())
s =input()
x = 0
l = []
for i in range(n):
    if s[i] == 'I':
        x += 1
    elif s[i] == 'D':
        x -= 1
    l.append(x)
print(max(l))
# Judge status: Accepted
import math
n = int(input())
div = math.floor(math.sqrt(n))
def sosu(n):
    if n <= 1:
        return False
    for i in range(2,div+1):
        if n%i==0:
            return False
    return True
while True:
    if sosu(n):
        print(n)
        break
    else:
        n+=1
# Judge status: Accepted
N = int(input())
if N % 2:
    print(0)
    exit()
a = 10
ans = 0
while N >= a:
    ans += N//a
    a *= 5
print(ans)
# Judge status: Accepted
def main():
    A = map(int, input().split())
    A = map(lambda x: x % 3, A)

    r = 0
    for x in A:
        r = (r + x) % 3
        if x == 0 or r == 0:
            print('Possible')
            return

    print('Impossible')


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, Y = map(int, input().split())
X = list(map(int, input().split()))

ans = 10**9
X2 = sorted(X)

for i in range(1, len(X)):
    ans = min(ans, abs(X2[i]-X2[i-1]))
for x in X:
    ans = min(ans, abs(Y-x))

print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
n,k,s=map(int,input().split())
if k==0:
    if s<10**9:
        a=s+1
    else:
        a=s-1
    ans=[]
    for i in range(n):
        ans.append(a)
    print(*ans)
    exit()
ans=[]
for i in range(n-k):
    if s<10**9:
        a=s+1
    else:
        a=s-1
    ans.append(a)
for j in range(k):
    ans.append(s)
print(*ans)
# Judge status: Wrong Answer
s = str(input())
S = s.split('/')
if int(S[0]) < 2019:
  print('TBD')
else :
  if int(S[1]) < 4:
    print('TBD')
  else:
    if int(S[2]) < 30:
      print('TBD')
    else:
      print('Heisei')
# Judge status: Accepted
N,K=map(int,input().split())
A=list(map(int,input().split()))
num=[0 for i in range(N)]
for i in range(N):
    num[A[i]-1]+=1

num.sort()
sum=0
for i in range(N-K):
    sum+=num[i]

print(sum)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
MOD = 10**9+7

li = [0 for i in range(61)]

for i in range(0, len(A)):
    _a = A[i]
    for j in range(len(li))[::-1]:
        quo = _a // pow(2, j)
        li[j] += quo
        _a -= quo*pow(2, j)


res = 0
print(li)
for i in range(len(li)):
    res += (pow(2, i) * (li[i]*(N-li[i])))%MOD
    res %= MOD
print(res)
# Judge status: Accepted
n=int(input())
print(''.join([chr((ord(c)+n-65)%26+65) for c in input()]))
# Judge status: Accepted
N,M=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]
C=[list(map(int,input().split())) for i in range(M)]
for i in range(N):
    z=10**10
    ans=0
    for t in range(M):
        if (abs(A[i][0]-C[t][0])+abs(A[i][1]-C[t][1]))<z:
            z=(abs(A[i][0]-C[t][0])+abs(A[i][1]-C[t][1]))
            ans=t+1
        else:
            continue
    print(ans)
# Judge status: Accepted
from sys import stdin
import re
import bisect
import numpy as np

N, K = map(int, stdin.readline().rstrip().split())
frag = np.zeros((K,N), dtype=bool)
for i in range(K):
    _ = stdin.readline()
    line = map(int, stdin.readline().rstrip().split())
    for j in line:
        j -= 1
        frag[i][j] = True
        
count = int(0)
frag = frag.T
for i in range(N):
    if np.count_nonzero(frag[i] == 1) == 0:
        count += 1
print(count)
# Judge status: Accepted
n = int(input())
d = list(map(int,input().split()))

d.sort()

if n%2 == 0:
  ans = d[n//2] - d[n//2 - 1]
elif n%2 == 1:
  ans = d[n//2 + 1] - d[n//2 - 1]
  
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
if n>=m:
  print(0)
  exit()
a=list(map(int,input().split()))
a=sorted(a)
b=[0]*(m-1)
for i in range(m-1):
	b[i]=a[i+1]-a[i]
b=sorted(b)
b=b[:m-1-(n-1)]
print(sum(b))
# Judge status: Accepted
T = input().split()
A = [int(a) for a in input().split()]
B = input()
if T[0] == B:
	print(A[0]-1,A[1])
else:
	print(A[0],A[1]-1)
# Judge status: Accepted
X=int(input())
for i in range(-150,150):
  for j in range(-150,150):
    if i**5-j**5==X:
      A=i
      B=j
print(*[A,B])
# Judge status: Wrong Answer
# -*- coding: <encoding name> -*-

s = input()
t = input()

print('Yes' if sorted(s) < sorted(t) else 'No')
# Judge status: Accepted
import math
n=int(input())
t=[]
for i in range(5):
    ti=int(input())
    t.append(ti)
print(math.ceil(n/min(t))+4)
# Judge status: Accepted
s=input()
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
x = 0
y = sum(a)
ans = 10**10
for i in range(n-1):
    x += a[i]
    y -= a[i]
    ans = min(abs(x-y), ans)
print(ans)
# Judge status: Wrong Answer
n = int(input())
c = 1
max_c = 1
max_num = 1

for i in range(1, n+1):
    if i % 2 == 0:
        j = i
        c = 1
        j /= 2
        while j % 2 == 0:
            c += 1
            j /= 2
    if c > max_c:
        max_c = c
        max_num = i

print(max_num)
# Judge status: Accepted
k, n = map(int, input().split())
a = list(map(int, input().split()))

ds = [a[0] + k - a[-1]]
for i in range(n-1):
  ds.append(a[i+1]-a[i])
  
print(k-max(ds))
# Judge status: Wrong Answer
def main():
    A, B, C, D = map(int, input().split())

    if D <= A or B <= C:
        ans = 0
    if C <= A and A <= D:
        ans = D - A
    if C <= B and B <= D:
        ans = B - C
    if A <= C and D <= B:
        ans = D - C
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s=input()
print('Yes' if s[0]=='A' and s[2]=='C' and str.islower(s[1]+s[3:]) else 'No')
# Judge status: Accepted
N = int(input())
pri_cnt = {}
n = N
i = 2

while i ** 2 <= N:
  while n % i == 0:
    if i not in pri_cnt:
      pri_cnt[i] = 1
    else:
      pri_cnt[i] += 1
    n = n / i
  if (i == 2):
    i += 1
  else:
    i += 2

if n > 1:
  pri_cnt[int(n)] = 1

ans = 0
for pri, cnt in pri_cnt.items():
  count = 1
  remain = cnt
  while remain >= count:
    ans += 1
    remain -= count
    count += 1
print(ans)
# Judge status: Wrong Answer
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
S = input()

from collections import defaultdict
d = defaultdict(int)

for i in range(N):
    s = S[i]
    d[s] += 1
cnt = 0
for i in range(N-2):
    for j in range(i,N-1):
        k = 2*j - i
        if k <= N-1 and (S[i] != S[j] and S[j] != S[k] and S[k] != S[i]):
            cnt += 1
if d["R"] and d["G"] and d["B"]:
    ans = d["R"] * d["G"] * d["B"] - cnt
    print(ans)
# Judge status: Accepted
import sys

if __name__ == '__main__':
    S, W = map(int, input().split())
    print('unsafe' if W >= S else 'safe')
# Judge status: Accepted
n, *a = map(int, open(0).read().split())
s = [i%4 for i in a]
f, t = s.count(0), s.count(2)
print("YNeos"[n-f-t+(t>0) > f+1::2])
# Judge status: Accepted
import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(4 + math.ceil(n / min(a, b, c, d, e)))
# Judge status: Wrong Answer
s = int(input())

a = s // 10 ** 9
b = 10 ** 9 * a - s
 
print(0, 0, 1, 10 ** 9, a, b)
# Judge status: Accepted
h = int(input())
w = int(input())
n = int(input())


def f(x):
    if x % 1 == 0:
        return int(x)
    else:
        return int(x) + 1


y = f(n / max(h, w))
print(y)
# Judge status: Wrong Answer
n,a,b = map(int,input().split())
ans = 0
for i in range(1, n+1):
  if a <= sum(map(int, list(str(i)))) <= b:
    ans += 1
print(ans)
# Judge status: Wrong Answer
n,m = list(map(int, input().split()))

for i in range(m):
  x = i
  y = m + (m - i - 1)
  print(x+1,y+1)
# Judge status: Accepted
N,Y = map(int,input().split())

for x in range(N+1):
  for y in range(N+1):
    z = N-x-y
    if 0<=z and 10000*x+5000*y+1000*z==Y:
      print(x,y,z)
      exit()

print(-1,-1,-1)
# Judge status: Accepted
def LI():
    return list(map(int, input().split()))


N = int(input())
H = LI()
ans = 0
count = 0
for i in range(1, N):
    if H[i-1] >= H[i]:
        count += 1
    else:
        ans = max(ans, count)
        count = 0
print(max(ans, count))
# Judge status: Wrong Answer
a,b,k=map(int,input().split())
a=min(a,b)
b=max(a,b)
li=[]

for i in range(1,a+1):
  if a%i==0 and b%i==0:
    li.append(i)
    
li.sort(reverse=True)

print(li[k-1])
# Judge status: Wrong Answer
N, A, B, C, D = map(int, input().split())
S = input()
for i in range(A - 1, max(C, D) - 1):
    if S[i] == S[i + 1] == '#':
        print("No")
        exit()

if C < D:
    print("Yes")
else:
    for i in range(B - 2, D):
        if S[i:i + 3] == '...':
            print("Yes")
            exit()
    print('No')
# Judge status: Accepted
N=int(input())
S=list(input())



n=S.count("R")*S.count("G")*S.count("B")
count=0
for l in range(N-2):
    for r in range(l+2,N):
        m=(l+r)/2
        if m%1.0!=0:
            continue
        m=int(m)
        tmp =[S[l], S[r], S[m]]
        if len(set(tmp))==3:
            count+=1
            
            

print(n-count)
# Judge status: Wrong Answer
import numpy as np
from itertools import combinations

n, m, x = map(int, input().split())
lis = [list(map(int, input().split())) for _ in range(n)]
# print(n, m, x, lis)

ans = 10 ** 9
for i in range(1, n+1):
    combination = combinations(range(n), i)
    for comb in combination:
        init = np.zeros(m+1)
        for ind in list(comb):
            init = init + np.array(lis[ind])
        if np.amin(init) >= x:
            ans = min(ans,init[0])
    if ans < 10**9:
      print(int(ans))
      exit()
      
print(-1,-1,-1)
# Judge status: Accepted
n = int(input())
S = input()
cW = S.count('.')
cB = 0
ans = cW
for i in range(n):
    if S[i]=='#':
        cB += 1
    else:
        cW -= 1
    ans = min(ans, cW+cB)
print(ans)
# Judge status: Accepted
import sys
n = int(input())
for i in range(1,n+1):
    if int(i*1.08) == n:
        print(i)
        sys.exit()

print(":(")
# Judge status: Accepted
a,b,c, = map(int, input().split())
if 4*a*b < (c-b-a)**2 and c - b - a > 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#n = int(input())
#a = list(map(int, input().split()))
d, t, s = map(int, input().split())
#n = input()

if d <= t*s:
  print("Yes")
else:
  print("No")