Harryxun/stf_run huggingface dataset:
N = input()

l = len(N)
ans = 0
#各桁を「数字無し（０）」「７（１）」「５（２）」「３（３）」で記述するような4進数を作る
for n in range(1, 4**l):
  n4 = ""
  while n > 0:
    mod = n % 4
    n4 = str(mod) + n4
    n //= 4
  
  if "0" in n4:
    continue
  
  if ("1" in n4) and ("2" in n4) and ("3" in n4):
    n4_10 = ""
    for i in range(len(n4)):
      if n4[i] == "1":
        n4_10 = n4_10 + "7"
      elif n4[i] == "2":
        n4_10 = n4_10 + "5"
      else:
        n4_10 = n4_10 + "3"
    if int(n4_10) =< int(N):
      ans += 1

print(ans)

### FIXED CODE ###

N = input()

l = len(N)
ans = 0
#各桁を「数字無し（０）」「７（１）」「５（２）」「３（３）」で記述するような4進数を作る
for n in range(1, 4**l):
  n4 = ""
  while n > 0:
    mod = n % 4
    n4 = str(mod) + n4
    n //= 4
  
  if "0" in n4:
    continue
  
  if ("1" in n4) and ("2" in n4) and ("3" in n4):
    n4_10 = ""
    for i in range(len(n4)):
      if n4[i] == "1":
        n4_10 = n4_10 + "7"
      elif n4[i] == "2":
        n4_10 = n4_10 + "5"
      else:
        n4_10 = n4_10 + "3"
    if int(n4_10) <= int(N):
      ans += 1

print(ans)
data = [
    [[0 for r in range(10) for f in range(3)] for b in range(4)
]
    
count = int(input())
for c in range(count):
    b,f,r,v = [int(i) for i in input().split()]
    data[b-1] [f-1] [r-1] += v
    
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
        print()
     print()
    if bi < 3:
        print('#' * 20)

### FIXED CODE ###

data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]
    
count = int(input())
for c in range(count):
    b,f,r,v = [int(i) for i in input().split()]
    data[b-1] [f-1] [r-1] += v
    
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
        print()
    if bi < 3:
        print('#' * 20)
K = input()
S = input()
count = len(S)
list = 0
for i in range(K):
  i = S[list]
  list = list + 1
if (count <= K):
  print(S)
else:
  print(i+"...")

### FIXED CODE ###

k = int(input())
s = str(input())
if len(s) <= k:
    print(s)
else:
    print((s[:k]) + "...")
S = list(input()) + ['D']*100
N = len(S)-10
# print (S)
# print (N)
memo = [-1] * (N+100) 
# print (memo)

def check(k):
    if memo[k] != -1:
        return memo[k]
    if S[k+1] == 'B' and S[k+2] == 'C':
        memo[k] = check(k+2) + 1
        return memo[k]
    if S[k+1] == 'A':
        memo[k] = check(k+1)
        return memo[k]
    memo[k] = 0
    return memo[k]

ans = 0
for i in range(N):
    if S[i] =='A':
        ans += check(i)
print (ans)


### FIXED CODE ###

#再帰回数が多すぎてエラー
import sys

sys.setrecursionlimit(210000)
S = list(input()) + ['D']*100
N = len(S)-10

# print (S)
# print (N)

memo = [-1] * (N+100) 

# print (memo)

def check(k):
    if memo[k] != -1:
        return memo[k]
    if S[k+1] == 'B' and S[k+2] == 'C':
        memo[k] = check(k+2) + 1
        return memo[k]
    if S[k+1] == 'A':
        memo[k] = check(k+1)
        return memo[k]
    memo[k] = 0
    return memo[k]

ans = 0
for i in range(N):
    if S[i] =='A':
        ans += check(i)
print (ans)
n = int(input())
h = list(map(int, input().split()))
cnt = 0
move_cnt = []
for i in range(n-1):
   if h[i] >= h[i+1]:
      cnt += 1
      move_cnt.append(cnt)
   else:
      cnt = 0
      move_cnt.append(cnt) 
print(max(move_cnt))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
cnt = 0
ans = 0
for i in range(n-1):
   if h[i] >= h[i+1]:
      cnt += 1
      ans = max(ans, cnt)
   else:
      cnt = 0
print(ans)
N,K = map(int,input().split())
p = list(map(int,input().split()))
 
a = [0]*N
f = sum(p[:K])

for i in range(N-K):
    f = f + p[i+K] - p[i]
    a[i] = f
    
num = 0

for i in range(1,N-K):
    if a[i] > a[i-1]:
        num = i
ans = 0

for i in range(num+1,num+K+1):
    ans += (p[i]+1)/2

print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
p = list(map(int,input().split()))
 
for i in range(N):
    p[i] = (p[i]+1)/2
a = [0]*(N-K+1)
f = sum(p[:K])
a[0] = f

for i in range(N-K):
    f = f + p[i+K] - p[i]
    a[i+1] = f

print(max(a))
x1, y1, x2, y2 = map(int, input().split())
print(((y2-y1)**2 + (x2-x1)**2)**(1/2))



### FIXED CODE ###

x1, y1, x2, y2 = map(float, input().split())
print(((y2-y1)**2 + (x2-x1)**2)**(1/2))
k = int(input())
a, b = a // 2 + a % 2, a // 2
print(a * b)



### FIXED CODE ###

k = int(input())
a, b = k // 2 + k % 2, k // 2
print(a * b)
import numpy as np
import math
N, K = map(int, input().split())
A = list(map(int, input().split()))

def leng(n, f):
    return math.ceil(n / f) - 1

logs = np.array(A)
vleng = np.vectorize(leng)

#めぐる式二分探索
def is_ok(i):
    if sum(vleng(logs, i)) <= K:
        return True
    else:
        return False

def meguru_bisect(ng, ok):
    '''
    初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
    まずis_okを定義すべし
    ng ok は  とり得る最小の値-1 とり得る最大の値+1
    最大最小が逆の場合はよしなにひっくり返す
    '''
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok

print(meguru_bisect(0, 10 ** 9 + 1))

### FIXED CODE ###

import numpy as np
import math
N, K = map(int, input().split())
A = list(map(int, input().split()))

#めぐる式二分探索
def is_ok(i):
    su = 0
    for a in A:
        su += (a-1) // i
    if su <= K:
        return True
    else:
        return False

def meguru_bisect(ng, ok):
    '''
    初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
    まずis_okを定義すべし
    ng ok は  とり得る最小の値-1 とり得る最大の値+1
    最大最小が逆の場合はよしなにひっくり返す
    '''
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok

print(meguru_bisect(0, max(A) + 1))
class Unionfind():  # Unionfind
    def __init__(self, N):
        self.N = N
        self.parents = [-1] * N

    def find(self, x):  # グループの根
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):  # グループの併合
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):  # グループのサイズ
        return - self.parents[self.find(x)]


n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]

uf = Unionfind(n)
ans, cnt = [], n * (n - 1) // 2
for a, b in ab[::-1]:
    a -= 1, b -= 1
    ans.append(max(cnt, 0))
    if uf.find(a) != uf.find(b):
        cnt -= uf.size(a) * uf.size(b)
        uf.union(a, b)
print(*ans[::-1], sep='\n')


### FIXED CODE ###

class Unionfind():  # Unionfind
    def __init__(self, N):
        self.N = N
        self.parents = [-1] * N

    def find(self, x):  # グループの根
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):  # グループの併合
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):  # グループのサイズ
        return - self.parents[self.find(x)]

    def same(self, x, y):  # 同じグループか否か
        return self.find(x) == self.find(y)


n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]

uf = Unionfind(n)
ans, cnt = [], n * (n - 1) // 2
for a, b in ab[::-1]:
    ans.append(max(cnt, 0))
    if not uf.same(a - 1, b - 1):
        cnt -= uf.size(a - 1) * uf.size(b - 1)
        uf.union(a - 1, b - 1)
print(*ans[::-1], sep='\n')
n = int(input())
i = 1
sum = 0
for i in range(1,n){
  sum += i
print i

### FIXED CODE ###

n = int(input())
i = 1
sum = 0
for i in range(1,n + 1):
  sum += i
print(sum)
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
cnt = 0
for i in range(n):
  a = list(map(int,input().split()))
  res=0
  for j in range(m):
    res += a[i]*b[i]
  if res+c>0: cnt+=1
print(cnt)

### FIXED CODE ###

n,m,c = map(int,input().split())
b = list(map(int,input().split()))
cnt = 0
for i in range(n):
    res=0
    a = list(map(int,input().split()))
    for j in range(m):
        res += a[j]*b[j]
    if res+c>0: cnt+=1
print(cnt)
a=input()
b=input()
c=a*b
if c%2==1:
  print('Odd')
elif c%2==0:
  print('Even')

### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2==0:
  print("Even")
else:
  print("Odd")
n=int(input())

s=list(map(int,input().split()))

cnt=[-1,-1,-1]

result=1

for item in s:

    temp=item-1
    result=result*cnt.count(temp)
    cnt[cnt.index(temp)]=cnt[cnt.index(temp)]+1

print(result)

### FIXED CODE ###

n=int(input())

s=list(map(int,input().split()))

cnt=[-1,-1,-1]

result=1

for item in s:

    temp=item-1
    if temp in cnt:
        result=result*cnt.count(temp)
        cnt[cnt.index(temp)]=cnt[cnt.index(temp)]+1
    else:
        print(0)
        exit()

print(result%1000000007)
A, B, C, X = map(int, [input() for i in range(4)])

count = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if 500 * a + 100 * b + 50 * c == X:
                count += 1

print(count)

### FIXED CODE ###

X, A, B = map(int, [input() for i in range(3)])
print((X - A) % B)
S = input()
K = int(input())
S = S.replace("1","")
print(S[0])

### FIXED CODE ###

S = input()
K = int(input())

if len(S)>=K and S[:K] == "1"*K:
  print("1")
else:
  S = S.replace("1","")
  print(S[0])
t=list(map(int,input().spplit()))
for i in range(5):
  if t[i]==0:
    print(i+1)

### FIXED CODE ###

t=list(map(int,input().split()))
for i in range(5):
  if t[i]==0:
    print(i+1)
n=int(input())
c=[list(map(int,input().split())) for _ in range(n)]
c.sort()
q,w=c[n//2][0],min(c[n//2][1],c[n//2+1][1])
c.sort(key=lambda x: x[1])
e,r=max(c[n//2][0],c[n//2-1][1]),c[n//2][1]
if n%2==0:
    print(r-q+1+e-w)
else:
    print(r-q+1)

### FIXED CODE ###

n=int(input())
a,b=[],[]
for _ in range(n):
    i,j=map(int,input().split())
    a+=[i]
    b+=[j]
a.sort()
b.sort()
c=n//2
if n%2==1:
    print(b[c]-a[c]+1)
else:
    print(b[c]-a[c]+b[c-1]-a[c-1]+1)
S=input()
l=len(S)
z=0
for x in range(l):
    for y in range(l-x-3):
        T=S[x:x+y+4]
        t=int(T)
        
        if t%2019==0:
            z+=1
print(z)


### FIXED CODE ###

S,W=map(int,input().split())
if W>=S:
    print('unsafe')
else:
    print('safe')
# coding: utf-8
# Your code here!
n = int(input())
s = list(map(int,input().split()))
ans = {}
#各番号がいくつずつあるのかを整理
#keyに番号、valueにその番号が書かれてあるボールの数
for i in range(n):
    if not　s[i] in ans.keys():
        ans[s[i]] = 1
    else:
        ans[s[i]] += 1
#iC2の総和
answer = 0
for i in ans.values():
    answer += i
#answer-nC2+(n-1)C2 = answer-n+1
#nはans[s[i]],よって以下の出力で求められる
for i in range(n):
    print(answer-ans[s[i]]+1)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
List={}
x=0
for i in range(n):
    if not a[i] in List:
        List[a[i]] = 1
    else:
        List[a[i]]+=1
    
sigma=0
 
for key,item in List.items():
    sigma += item*(item-1)//2
for i in range(n):
    print(sigma-List[a[i]]+1)
s,t = map(str,input().split())
a,b = map(int,input().split())
u = str(input())
if u == s:
  print(int(a-1) int(b))
else:
  print(int(a) int(b-1))

### FIXED CODE ###

s,t = map(str,input().split())
a,b = map(int,input().split())
u = str(input())
if u == s:
  print('{} {}'.format(a-1,b))
else:
  print('{} {}'.format(a,b-1))
import math
n = input()
a = list(map(int,input().split()))
ans = float("inf")
for i in a:
  ans = min(ans, len(bin(i)) - bin(i).rfing("1") - 1)
print(round(ans)

### FIXED CODE ###

import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
n = int(input())

lastch = ''
answer = 'No'
words = []

for i in range(n):
    word = raw_input()
    words.append(word)
    if lastch == word[0] and i != 0:
        answer = 'Yes'
    else:
        answer = 'No'
    lastch = word[-1]

print('Yes' if len(words) == len(set(words)) and answer == 'Yes' else 'No')


### FIXED CODE ###

n = int(input())

lastch = ''
answer = 'Yes'
words = []
for i in range(n):
    word = list(input())
    words.append(''.join(word))
    if lastch != word[0] and i != 0:
        answer = 'No'
    lastch = word[-1]

if len(set(words)) != len(words):
    answer = 'No'

print(answer)
import math
r = input()
print(f"{math.pi * r ** 2}"}

### FIXED CODE ###

R = int(input())
circumference = 2 * 3.14 * R
print(circumference)
import math

N, M = list(map(int, input().split()))
S = input()
T = input()
gcd = math.gcd(N, M)
lcm = N*M//gcd
if N%M==0 or M%N==0:
    exist = True
    if N>M:
        for i in range(M):
            if S[N//M*i]!=T[i]:
                exist = False
                break
    else:
        for i in range(N):
            if T[M//N*i]!=S[i]:
                exist = False
                break
    if exist:
        print(max(N, M))
    else:
        print(-1)
else:
    print(lcm)


### FIXED CODE ###

import math

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

N, M = list(map(int, input().split()))
S = input()
T = input()
g = gcd(N, M)
lcm = N*M//g
if N%M==0 or M%N==0:
    exist = True
    if N>M:
        for i in range(M):
            if S[N//M*i]!=T[i]:
                exist = False
                break
    else:
        for i in range(N):
            if T[M//N*i]!=S[i]:
                exist = False
                break
    if exist:
        print(max(N, M))
    else:
        print(-1)
else:
    n_s = lcm//N
    n_t = lcm//M
    mul = n_s*n_t
    exist = True
    for i in range(0, lcm, mul):
        if S[i//n_s]!=T[i//n_t]:
            exist = False
            break
    if exist:
        print(lcm)
    else:
        print(-1)
n = int(input())
a,b=[],[]
for i in range(1,int(n**0.5)):
    if n%i==0:
        a.append(i)
        b.append(n//i)
ans=[]
for i in range(len(a)):
    ans.append(max(len(str(a[i])),len(str(b[i]))))
print(min(ans))

### FIXED CODE ###

n = int(input())
a,b=[],[]
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        a.append(i)
        b.append(int(n/i))
ans=[]
for i in range(len(a)):
    ans.append(max(len(str(a[i])),len(str(b[i]))))
print(min(ans))
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd



def solve(N: int, X: int):
    a, p = [1], [1]
    for i in range(N-1):
        a.append(a[i] * 2 + 3)
        p.append(p[i] * 2 + 1)

    def _f(N, X):
        if N == 0:
            return 0 if X <= 0 else 1
        elif X < 1 + a[N-1]:
            return _f(N-1, X-1)
        elif X < 2 * (1 + a[N-1]):
            return p[N-1] + 1 + _f(N-1, X - 2 - a[N-1])
        else:
            return p[N]

    return _f(N, X)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    result = solve(N, X)
    print(result)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd



def solve(N: int, X: int):
    a, p = [1], [1]
    for i in range(N):
        a.append(a[i] * 2 + 3)
        p.append(p[i] * 2 + 1)

    def _f(N, X):
        if N == 0:
            return 0 if X <= 0 else 1
        elif X <= 1 + a[N-1]:
            return _f(N-1, X-1)
        elif X < a[N]:
            return p[N-1] + 1 + _f(N-1, X - 2 - a[N-1])
        else:
            return p[N]

    return _f(N, X)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    result = solve(N, X)
    print(result)

if __name__ == '__main__':
    main()
s1=input()
s2=input()
s1=s1.lower()
s2=s2.lower()
flag=0
if(len(s1)>len(s2)):
   a=len(s2)
else:
    a=len(s1)

for i in range(0,a):
    if(s1[i]==s2[i]):
        flag=flag+1
    elif(s1[i]>s2[i]):
            print('>')
            break;
    elif(s1[i]<s2[i]):
            print('<')
            break;
if(flag==a):
    if(len(s1)>len(s2)):
        print(">")

    elif(len(s1)<len(s2)):
        print("<")
    else:
            print("=")
        
    
       
    


### FIXED CODE ###

s1,s2=input().split(" ")
s1=s1.lower()
s2=s2.lower()
flag=0
if(len(s1)>len(s2)):
   a=len(s2)
else:
    a=len(s1)

for i in range(0,a):
    if(s1[i]==s2[i]):
        flag=flag+1
    elif(s1[i]>s2[i]):
            print('>')
            break;
    elif(s1[i]<s2[i]):
            print('<')
            break;
if(flag==a):
    if(len(s1)>len(s2)):
        print(">")

    elif(len(s1)<len(s2)):
        print("<")
    else:
            print("=")
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
dp = [0, -int('inf')]
cost = [0,2,5,5,4,5,6,3,7,6]
for i in range(2, N+1):
    dp.append(-int('inf'))
    for a in A:
        if i >= cost[a]: 
            dp[i] = max(dp[i - cost[a]] + 1, dp[i])
ans = ""
while N > 0:
    for e in A:
        if dp[N] - 1 == dp[N - cost[e]]:
            if dp[N] == 1:
                if N != cost[e]: continue
            N -= cost[e]
            ans += str(e)
            break
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
dp = [0]
cost = [0,2,5,5,4,5,6,3,7,6]
for i in range(1, N+1):
    dp.append(-(2<<10))
    for a in A:
        if i >= cost[a]: 
            dp[i] = max(dp[i - cost[a]] + 1, dp[i])
ans = ""
while N > 0:
    for e in A:
        if N >= cost[e] and dp[N] - 1 == dp[N - cost[e]]:
            if dp[N] == 1:
                if N != cost[e]: continue
            N -= cost[e]
            ans += str(e)
            break
print(ans)
N = int(input())
H = [int(n) for n in input().split()]
ans = 0
for i in range(1, N+1):
  t = max(H[:i])
  if t <= H[i]:
    ans += 1
print(ans)


### FIXED CODE ###

N = int(input())
H = [int(n) for n in input().split()]
ans = 0
for i in range(1, N+1):
  t = max(H[:i])
  if t <= H[i-1]:
    ans += 1
print(ans)
a, b, h = map(int, input().split())

answer = (a + b) * h // 2

print(answer)

### FIXED CODE ###

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

answer = (a + b) * h // 2

print(answer)
n, m = map(int, input().split())
x = sorted([int(i) for i in input().split()])
diff_x = [x[i + 1] - x[i] for i in range(m - 1)]
max_diff = []
for _ in range(n - 1):
    max_diff_i = diff_x.index(max(diff_x))
    max_diff.append(max_diff_i)
    diff_x[max_diff_i] = -1
max_diff.sort()

move = x[max_diff[0]] - x[0]
for i in range(n - 2):
    move += x[max_diff[i + 1]] - x[max_diff[i] + 1]
move += x[m - 1] - x[max_diff[n - 2] + 1]
print(move)

### FIXED CODE ###

n, m = map(int, input().split())
x = sorted([int(i) for i in input().split()])
diff_x = [x[i + 1] - x[i] for i in range(m - 1)]
diff_x.sort(reverse=True)
if n >= m:
    print(0)
else:
    print((x[m - 1] - x[0]) - sum(diff_x[0:n - 1]))
N, K = map(int, input().split())
S = list(input())
bw = [0] * N
ind = 0
for i in range(N):
  bw[ind] += S[i] == S[i + 1]
  if S[i] != S[i + 1]:
    bw[ind] += 1
    ind += 1
ind = 0
res = 0
cumsumbw = [0] + [bw[0]] + [0] * (N - 1)
for i in range(1, N):
  cumsumbw[i + 1] = cumsumbw[i] + bw[i]
if N - 2 * K <= 0:
  print(N)
  exit(0)
for i in range(N - 2 * K):
  if S[i] == "1":
    res = max(res, cumsumbw[i + 2 * K + 1] - cumsumbw[i])
  else:
    res = max(res, cumsumbw[i + 2 * K] - cumsumbw[i])
print(res)

### FIXED CODE ###

N, K = map(int, input().split())
S = list(input()) + [-1]
bw = [0] * N
ind = 0
for i in range(N):
  bw[ind] += S[i] == S[i + 1]
  if S[i] != S[i + 1]:
    bw[ind] += 1
    ind += 1
ind = 0
res = 0
cumsumbw = [0] + [bw[0]] + [0] * (N - 1)
for i in range(1, N):
  cumsumbw[i + 1] = cumsumbw[i] + bw[i]
if N - 2 * K <= 0:
  print(N)
  exit(0)
for i in range(N - 2 * K):
  if S[cumsumbw[i]] == "1":
    res = max(res, cumsumbw[i + 2 * K + 1] - cumsumbw[i])
  else:
    res = max(res, cumsumbw[i + 2 * K] - cumsumbw[i])
  #print(res)
print(res)
#print(bw)
#print(cumsumbw)
i = list(map(int, input().split()))
j = list(map(int, input().split()))
sumj=0
for k in range(len(j)):
  sumj+=j[k]
if i[0]<=sumj:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

i = list(map(int, input().split()))
j = list(map(int, input().split()))
if i[0]<=sum(j):
  print("Yes")
else:
  print("No")
a = int(input())
b = int(input())
print(a*b//2)


### FIXED CODE ###

a,b,c = map(int,input().split())
print(a*b//2)
x = int(input())
for i in range(-118, 120):
  for j in range(-119, 119):
    if i**5 - j** = x:
      print(i, j)
      exit(0)

### FIXED CODE ###

x = int(input())
for i in range(-118, 120):
  for j in range(-119, 119):
    if i**5 - j**5 == x:
      print(i, j)
      exit(0)
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

#リストをソート
a=sorted(a)
b=sorted(b)
c=sorted(c)

#二分探索(x以上の最小値index) !同じ物は一個下げる
def lower_bound(arr,x):
    l=0
    r=len(arr)-1#数列arrの最後尾のインデックス
    while l<=r:
        mid=(l+r)//2#中央値検索
        if x==arr[mid]:#ちょうど中央値に存在したとき
            return mid+1
        elif x<arr[mid]:#xが左側の配列に存在するとき
            r=mid-1
        else:#xが右側の配列に存在するとき
            l=mid+1
        #print(mid,r,l)
    return r+1

#二分探索(x以下の最大値)
def upper_bound(arr,x):
    l=0
    r=len(arr)-1#数列arrの最後尾のインデックス
    while l<=r:
        mid=(l+r)//2#中央値検索
        if x==arr[mid]:#ちょうど中央値に存在したとき
            return mid-1
        elif x<arr[mid]:#xが左側の配列に存在するとき
            r=mid-1
        else:#xが右側の配列に存在するとき
            l=mid+1
        #print(mid,r,l)
    return r

#個数をカウント
count=0
for i in range(n):
    if min(a)>=b[i] or max(c)<=b[i]:
        count=0
    elif:
        a_count=upper_bound(a,b[i])+1#b要素固定でのa要素の個数
        c_count=lower_bound(c,b[i])+1#b要素固定でのc要素の個数
        count+=a_count*(len(c)-c_count+1)
        #print(upper_bound(a,b[i]),lower_bound(c,b[i]))
        #print(a_count,len(c),c_count,len(c)-c_count+1)
        #print(count)

print(count)


### FIXED CODE ###

# 二分探索
import bisect

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

#リストをソート
a=sorted(a)
b=sorted(b)
c=sorted(c)

count=0
#a[i]の個数
for i in range(n):
    a_count = bisect.bisect_left(a, b[i])
    c_count = bisect.bisect_right(c, b[i])
    count+=a_count*(len(c)-c_count)

print(count)
#!/usr/bin/env python3
import sympy
from bisect import bisect_left

def main():
    N, M = map(int, input().split())
    ans = sympy.divisors(M)
    i = bisect_left(ans,N)
    print(M//ans[i])

if __name__ == "__main__":
    main()

### FIXED CODE ###

#!/usr/bin/env python3
from bisect import bisect_left
from heapq import heappush

def cal_divisors(N):
    divisors = []
    i = 1
    while i*i <= N:
        if N % i == 0:
            divisors.append(i)
            if i != N // i:
                divisors.append(N//i)
        i += 1
    divisors.sort()
    return divisors

def main():
    N, M = map(int, input().split())
    ans = cal_divisors(M)
    # print(ans)
    i = bisect_left(ans,N)
    print(M//ans[i])

if __name__ == "__main__":
    main()