Harryxun/stf_run huggingface dataset:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
d = [a[0],b[0],c[0]]
e = [a[1],b[1],c[1]]
f = [a[2],b[2],c[2]]
g = [a[0],b[1],c[2]]
h = [a[2],b[1],c[0]]

n = int(input())

bs = []
for _ in range(n):
    bs.append(int(input())
       
for l in [a,b,c,d,e,f,g,h]:
    if (l[0] in bs) and (l[1] in bs) and (l[2] in bs):
        print("Yes")
        break
else:
    print("No")


### FIXED CODE ###

a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
d = [a[0],b[0],c[0]]
e = [a[1],b[1],c[1]]
f = [a[2],b[2],c[2]]
g = [a[0],b[1],c[2]]
h = [a[2],b[1],c[0]]

n = int(input())

bs = []
for _ in range(n):
    bs.append(int(input()))

for l in [a,b,c,d,e,f,g,h]:
    if (l[0] in bs) and (l[1] in bs) and (l[2] in bs):
        print("Yes")
        break
else:
        print("No")
in = input()
key = "keyence"
for i in range(len(in)):
  for j in range(i, len(in)):
    if (in[i:j] == key):
      print("YES")
      exit()
print("NO")


### FIXED CODE ###

a = input()
key = "keyence"
for i in range(len(a)):
  for j in range(i, len(a)):
    if (a[:i] + a[j:] == key):
      print("YES")
      exit(0)
print("NO")
a = int(input())
b = int(input())
  
print(str(a*b)+""+str(2a + 2b))

### FIXED CODE ###

z = input()
m,l = z.split()
s = int(m) * int(l)
n = int(m)*2 + int(l)*2

print("{} {}".format(str(s),str(n)))
N = int(input())
A = map(int,input().split())
n = 0
can = True

while can:
    for i in range(N):
        if A[i]%2 == 0:
            A[i] = (A[i]/2)
            n += 0
    else:
        break

print(n)
        

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
n = 0
F = 0

while 1:
    #すべてが偶数か確認
    for i in range(N):
        if A[i] % 2 == 0:
            continue
        else:
            F = 1
    
    if F == 1 : break 

    for i in range(N):
        A[i] = A[i]/2
    n += 1


print(n)
a = input()
if s == "SSS":
    print(0)
elif s == "SSR":
    print(1)
elif s == "SRS":
    print(1)
elif s == "SRR":
    print(2)
elif s == "RSS":
    print(1)
elif s == "RSR":
    print(1)
elif s == "RRS":
    print(2)
elif s == "RRR":
    print(3)

        

### FIXED CODE ###

s = input()
if s == "SSS":
    print(0)
elif s == "SSR":
    print(1)
elif s == "SRS":
    print(1)
elif s == "SRR":
    print(2)
elif s == "RSS":
    print(1)
elif s == "RSR":
    print(1)
elif s == "RRS":
    print(2)
elif s == "RRR":
    print(3)
s = input()
if s = 'Sunny':
  print("Cloudy")
elif s = "Cloudy":
  print("Rainy")
else:
  print("Sunny")

### FIXED CODE ###

s = input()
if s == 'Sunny':
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
import numpy as np
N = int(input())
cnt = 0
for i in range(1, int(np.ceil(np.sqrt(N)))):
    if (N-i)%i ==0:
        cnt += int((N-i)/i)
print(cnt)

### FIXED CODE ###

import numpy as np
N = int(input())
cnt = 0
for i in range(1, int(np.ceil(np.sqrt(N)))):
    if (N-i)%i ==0 and (N-i)/i >i:
        cnt += int((N-i)/i)
print(cnt)
a = x*x*x
 print "%d" & (a)

### FIXED CODE ###

x = input()
ans = x**3
print ans
def f(hp):
    if hp <= 0: return 0
    if dp[hp] >= 0: return dp[hp]
    ret = f(hp - a[0]) + b[0]
    for i in range(1, n):
        ret = min(ret, f(hp-a[i]) + b[i])
    dp[hp] = ret
    return ret

h, n = map(int, input().split())
a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())

dp = [0] + [-1] * h
print(f(h))


### FIXED CODE ###

h, n = map(int, input().split())
a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())

dp = [0] + [-1] * h
INF = 10**18
for hp in range(1, h+1):
    ret = INF
    for i in range(n):
        if hp - a[i] >= 0:
            ret = min(ret, dp[hp-a[i]] + b[i])
        else:
            ret = min(ret, b[i])
    dp[hp] = ret
print(dp[h])
n = int(input())
v = list(map(int, input().split()))
even = dict()
odd = dict()
for i in range(n//2):
  a = v[2*i]
  if a in even:
    even[a] += 1
  else:
    even[a] = 1
  a = v[2*i + 1]
  if a in odd:
    odd[a] += 1
  else:
    odd[a] = 1

even_sorted = sorted(even.items(), key=lambda x:x[1], reverse=True)
odd_sorted = sorted(odd.items(), key=lambda x:x[1], reverse=True)

if even_sorted[0][0] == odd_sorted[0][0]:
  print(n - max(even_sorted[0][1]+odd_sorted[1][1], even_sorted[1][1]+odd_sorted[0][1]))
else:
  print(n - even_sorted[0][1] - odd_sorted[0][1])

### FIXED CODE ###

n = int(input())
v = list(map(int, input().split()))
even = dict()
odd = dict()
even[0] = 0
odd[0] = 0
for i in range(n//2):
  a = v[2*i]
  if a in even:
    even[a] += 1
  else:
    even[a] = 1
  a = v[2*i + 1]
  if a in odd:
    odd[a] += 1
  else:
    odd[a] = 1

even_sorted = sorted(even.items(), key=lambda x:x[1], reverse=True)
odd_sorted = sorted(odd.items(), key=lambda x:x[1], reverse=True)

if even_sorted[0][0] == odd_sorted[0][0]:
  print(n - max(even_sorted[0][1]+odd_sorted[1][1], even_sorted[1][1]+odd_sorted[0][1]))
else:
  print(n - even_sorted[0][1] - odd_sorted[0][1])
X=int(input())

if 0<=X<=399:
    print(9)
elif 400<=X<=599:
    print(8)
elif 600<=X<=799:
    print(7)
elif 800<=X<=999:
    prnit(6)
elif 1000<=X<=1199:
    print(5)
elif 1200<=X<=1399:
    print(4)
elif 1400<=X<=1599:
    print(3)
elif 1600<=X<=1799:
    print(2)
elif 1800<=X<=1999:
    print(1)
else:
    print(0)

### FIXED CODE ###

x = int(input())
 
if 400 <= x <= 599:
    print(8)
elif 600 <= x <= 799:
    print(7)
elif 800 <= x <= 999:
    print(6)
elif 1000 <= x <= 1199:
    print(5)
elif 1200 <= x <= 1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)
elif 1600 <= x <= 1799:
    print(2)
elif 1800 <= x <= 1999:
    print(1)
import numpy as np

def search(now,r,dist,ans):
    if len(r)==0:
        return ans
    min_=float('inf')
    for i,x in enumerate(r):
        if i < len(r)-1:
            min_=min(min_,search(x,r[:i]+r[i+1:],dist,ans+dist[now][x]))
        else:
            min_=min(min_, search(x,r[:i],dist,ans+dist[now][x]))
    return min_

N,M,R=list(map(int,input().split()))
r=list(map(int,input().split()))
r=[x-1 for x in r]
dist=[[float('inf') for _ in range(N)] for _ in range(N)]
for i in range(M):
    A,B,C=list(map(int,input().split()))
    dist[A-1][B-1]=C
    dist[B-1][A-1]=C
for i in range(N):
    dist[i][i]=0
dist=np.array(dist)

ans=float('inf')
for i in range(N):
    for j in range(N):
        dist[i][j]=min(dist[i]+dist[j])

ans=float('inf')
for i,x in enumerate(r):
    if i < len(r)-1:
        ans=min(ans, search(x,r[:i]+r[i+1:],dist,0))
    else:
        ans=min(ans, search(x,r[:i],dist,0))
print(int(ans))

### FIXED CODE ###

from itertools import permutations
from scipy.sparse.csgraph import floyd_warshall as ws

def search(r,dist,ans):
    sum_=0
    for i in range(1,len(r)):
        sum_+=dist[r[i-1]][r[i]]
    return sum_

N,M,R=list(map(int,input().split()))
r=list(map(int,input().split()))
r=[x-1 for x in r]
dist=[[float('inf') for _ in range(N)] for _ in range(N)]
for i in range(M):
    A,B,C=list(map(int,input().split()))
    dist[A-1][B-1]=C
    dist[B-1][A-1]=C
for i in range(N):
    dist[i][i]=0
dist=ws(dist)

ans=float('inf')

ans=float('inf')
r=permutations(r)
for x in r:
    ans=min(ans,search(x,dist,0))
print(int(ans))
a,b=map(int,input().split())
print(len([i for i in map(str,range(a,b+1)) if i==i[::-1]))

### FIXED CODE ###

a,b=map(int,input().split())
print(len([i for i in map(str,range(a,b+1)) if i==i[::-1]]))
a=[input() for i in range(2)]
P=a[0]
S=a[1]
count=0
for t in range(0,len(P)-1):
  if P[t] != S[t]:
    count=count++
print(count)

### FIXED CODE ###

a=[input() for i in range(2)]
P=a[0]
S=a[1]
count=0
for t in range(len(P)):
  if P[t] != S[t]:
    count=count+1
print(count)
import sys
a = int(sys.argv[1])
b = a ** 3
print b

### FIXED CODE ###

print int(raw_input()) ** 3
N, M = map(int, input().split())

gridA = [[v for v in input()] for _ in range(N)]
gridB = [[v for v in input()] for _ in range(M)]

for x_A in range(N):
    for y_A in range(N):
        ok = True
        for x_B in range(M):
            for y_B in range(M):
                if x_A+x_B > N or y_A+y_B > N:
                    break
                if gridA[x_A+x_B][y_A+y_B] == gridB[x_B][y_B]:
                    continue
                else:
                    ok = False
                    break
            else:
                continue
            break
        else:
            print("Yes")
            exit()
print("No")


### FIXED CODE ###

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

gridA = [[v for v in input()] for _ in range(N)]
gridB = [[v for v in input()] for _ in range(M)]

for x_A in range(N):
    for y_A in range(N):
        ok = True
        for x_B in range(M):
            for y_B in range(M):
                if x_A+x_B >= N or y_A+y_B >= N:
                    break
                if gridA[x_A+x_B][y_A+y_B] == gridB[x_B][y_B]:
                    continue
                else:
                    ok = False
                    break
            else:
                continue
            break
        else:
            print("Yes")
            exit()
print("No")
N,K = map(int,input().split())

D = set(map(int,input().split()))
A = {1,2,3,4,5,6,7,8,9,0}
N_list = [int(c) for c in str(N)]

use = sorted(list(A - D))

ans = [max(use) for i in range(len(N_list))]
mapans = map(str,ans)
x = int(''.join(mapans))
if N == x:
    print(x)
elif N > x:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list)+1)]
    else:
        ans = [use[0] for i in range(len(N_list))+1]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
else:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list))]
    else:
        ans = [use[0] for i in range(len(N_list))]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
    j = 0
    i = 0
    print(x)
    while x < N:
        if ans[j] > N_list[j]:
            for k in range(len(ans)-j-1):
                ans[k] = min(use)
        elif ans[j] == N_list[j]:
            i = 0
            j+=1
        else:
            ans[j] = use[i]
            i += 1
    mapans = map(str,ans)
    x = int(''.join(mapans))

    print(x)


### FIXED CODE ###

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

D = set(map(int,input().split()))
A = {1,2,3,4,5,6,7,8,9,0}
N_list = [int(c) for c in str(N)]

use = sorted(list(A - D))

ans = [max(use) for i in range(len(N_list))]
mapans = map(str,ans)
x = int(''.join(mapans))
if N == x:
    print(x)
elif N > x:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list)+1)]
    else:
        ans = [use[0] for i in range(len(N_list)+1)]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
    print(x)
else:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list))]
    else:
        ans = [use[0] for i in range(len(N_list))]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
    j = 0
    i = 0
    while x < N:
        if ans[j] > N_list[j]:
            for k in range(len(ans)-j-1):
                ans[k] = min(use)
        elif ans[j] == N_list[j]:
            i = 0
            j+=1
        else:
            i += 1
            ans[j] = use[i]
        mapans = map(str,ans)
        x = int(''.join(mapans))

    print(x)
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>
#include <iomanip>

using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

typedef long long LL;
typedef vector<int> VI;

int main() {
  int N;
  cin >> N;
  priority_queue<double, vector<double>,  greater<double>> q;
  int v;
  for (int i = 0; i < N; i++) {
    cin >> v;
    q.push((double)v);
  }
  while (q.size() > 1) {
    double v1 = q.top();
    q.pop();
    double v2 = q.top();
    q.pop();
    q.push((v1+v2)/2);
  }
  cout << fixed << setprecision(10) << q.top() << endl;
  return 0;
}


### FIXED CODE ###

import heapq

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

heapq.heapify(q)

while (len(q) > 1):
    v1 = heapq.heappop(q)
    v2 = heapq.heappop(q)
    heapq.heappush(q, (v1+v2)/2.0)

print(heapq.heappop(q))
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

anslist = p[:x] + q[:y]
anslist.sort()
for i, x in enumerate(r):
    if x > anslist[i]:
        anslist[i] = x

print(sum(anslist))

### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

anslist = p[:x] + q[:y]
anslist.sort()
for i, num in enumerate(r):
    if i >= x+y:
        break
    if num > anslist[i]:
        anslist[i] = num

print(sum(anslist))
l,r=map(int,input().split())
ans=2018
for i in range(l,r):
	for j in range(i+1,r+1):
    	if i*j%2019<ans:
        	ans=i*j%2019
        elif i*j%2019==ans:
        	print(ans)
            exit()
print(ans)

### FIXED CODE ###

l,r=map(int,input().split())
if l==0:
    print(0)
elif r*(r-1)<2019:
    print(l*(l+1))
else:
    ans=2018
    for i in range(l,r):
        for j in range(i+1,r+1):
            if i*j%2019<ans:
                ans=i*j%2019
            elif i*j%2019==ans:
                print(ans)
                exit()
    print(ans)
a,b,c=map(int,input().split())
if a+b+1<c:
    print(b+a+b+1)
elif a+b+1==c:
    print(b+c)
else a+b>c:
    if b+1>=c:
        print(c+1+c)
    elif b+1<c:
        print(b+c+1)

### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b+1<c:
    print(b+a+b+1)
elif a+b+1==c:
    print(b+c)
elif a+b+1>c:
    if b+1>=c:
        print(b+c)
    elif b+1<c:
        print(b+c)
from collections import Counter
n = int(input())
s = [input() for i in range(n)]

c = Counter(s)

for k in ['AC', 'WA', 'TLE', 'RE']:
    if k in c:
        print('{k} x {}'.format(k, c[k]))
    else:
        print('{} x {}'.format(k, c[k]))

### FIXED CODE ###

from collections import Counter
n = int(input())
s = [input() for i in range(n)]

c = Counter(s)

for k in ['AC', 'WA', 'TLE', 'RE']:
    if k in c:
        print('{} x {}'.format(k, c[k]))
    else:
        print('{} x {}'.format(k, c[k]))
def merge(A, left, mid, right):
  global count
  n1 = mid - left
  n2 = right - mid
  L = A[left:mid] + [float('inf')]
  R = A[mid:right] + [float('inf')]
  
  i = 0
  j = 0

  for k in range(left, right):
    if L[i] <= R[i]:
      A[k] = L[i]
      i += 1
    else:
      A[k] = R[j]
      j += 1
  count += right - left

def mergeSort(A, left, right):
  if left + 1 < right:
    mid = (left + right) // 2
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)

N = int(input())
A = list(map(int, input().split()))
count = 0
mergeSort(A, 0, N)
print(*A)
print(count)
    

### FIXED CODE ###

def merge(A, left, mid, right):
  global count
  L = A[left:mid] + [10**9 + 1]
  R = A[mid:right] + [10**9 + 1]
  
  i = 0
  j = 0

  for k in range(left, right):
    if L[i] <= R[j]:
      A[k] = L[i]
      i += 1
    else:
      A[k] = R[j]
      j += 1
  count += right - left

def mergeSort(A, left, right):
  if left + 1 < right:
    mid = (left + right) // 2
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)

N = int(input())
A = list(map(int, input().split()))
count = 0
mergeSort(A, 0, N)
print(*A)
print(count)
N = int(raw_input())
A = [0] * 100001

for i in range(N):
    a = int(raw_input())
    A[a] += 1

print sum([ 0 if A[i] % 2 == 0 else 1 for i in range(100001)])


### FIXED CODE ###

N = int(raw_input())
S = set()

for _ in range(N):
    A = int(raw_input())
    if A in S:
        S.remove(A)
    else:
        S.add(A)

print len(S)
K = input()
S = input()
s = len(S)
if (s <= K):
  print(S)


### FIXED CODE ###

k = int(input())
s = str(input())
if len(s) <= k:
    print(s)
else:
    print((s[:k]) + "...")
n = int(input())

if n%2 == 1:
    print("No")
else:
    s = list(input())
    s1 = s[:n//2].copy()
    s2 = s[n//2:]copy()
    if s1 == s2:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

n = int(input())

if n%2 == 1:
    print("No")
else:
    s = list(input())
    s1 = s[:n//2]
    s2 = s[n//2:]
    if s1 == s2:
        print("Yes")
    else:
        print("No")
from collections import deque

S = input()
Q = int(input())

q = deque()
rev = 0

for s in S:
  q.append(s)

for _ in range(Q):
  TFC = input()
  if len(TFC) == 1: # T == 1
    rev ^= 1
  else:
    T, F, C = (i for i in TFC.split())  
    if F == '1' and rev:
      q.append(C)
    else:
      q.appendleft(C)
      
ans = ''.join(q)

if reverse:
  print(ans[::-1])
else:
  print(ans)

### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())

q = deque()
rev = 0

for s in S:
  q.append(s)

for _ in range(Q):
  TFC = input()
  if len(TFC) == 1: # T == 1
    rev ^= 1
  else:
    T, F, C = (i for i in TFC.split())  
    if (F == '2' and not rev) or (F == '1' and rev):
      q.append(C)
    else:
      q.appendleft(C)
      
ans = ''.join(q)

if rev:
  print(ans[::-1])
else:
  print(ans)
import copy

def dfs(graph, v, d):
    seen[v] = True # 訪問済みかどうか
    dist[v] = d # 距離を記録

    # 頂点vから行ける頂点を全探索
    for i in graph[v]:
        if seen[i]:
            continue
        dfs(graph, i, d+1)

# ここから本文
N, u, v = map(int, input().split())

u -= 1
v -= 1

# グラフ構造を作る
graph = [[] for i in range(N)]
for i in range(N - 1):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    graph[A].append(B)
    graph[B].append(A)

# 青木くんからの各頂点の距離
seen = [False for i in range(N)]
dist = [0 for i in range(N)]
dfs(graph, v, 0)
aoki_dist = copy.deepcopy(dist)

# 高橋くんからの各頂点の距離
seen = [False for i in range(N)]
dist = [0 for i in range(N)]
dfs(graph, u, 0)
takahashi_dist = copy.deepcopy(dist)

ans = 0
for i in range(N):
    if aoki_dist[i] > takahashi_dist[i]:
        if aoki_dist[i] - 1 > ans:
            ans = aoki_dist[i] - 1      

print(ans)

### FIXED CODE ###


import copy
import sys

# 再帰上限を引き上げる
sys.setrecursionlimit(10**6)

def dfs(graph, v, d):
    seen[v] = True # 訪問済みかどうか
    dist[v] = d # 距離を記録

    # 頂点vから行ける頂点を全探索
    for i in graph[v]:
        if seen[i]:
            continue
        dfs(graph, i, d+1)

# ここから本文
N, u, v = map(int, input().split())

u -= 1
v -= 1

# グラフ構造を作る
graph = [[] for i in range(N)]
for i in range(N - 1):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    graph[A].append(B)
    graph[B].append(A)

# 青木くんからの各頂点の距離
seen = [False for i in range(N)]
dist = [0 for i in range(N)]
dfs(graph, v, 0)
aoki_dist = copy.deepcopy(dist)

# 高橋くんからの各頂点の距離
seen = [False for i in range(N)]
dist = [0 for i in range(N)]
dfs(graph, u, 0)
takahashi_dist = copy.deepcopy(dist)

ans = 0
for i in range(N):
    if aoki_dist[i] > takahashi_dist[i]:
        if aoki_dist[i] - 1 > ans:
            ans = aoki_dist[i] - 1      

print(ans)
n = input()
N = int(n)
l = len(n)
s = 0
for i in range(l):
  s += n[i]
if N % s == 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = input()
N = int(n)
l = len(n)
s = 0
for i in range(l):
  s += int(n[i])
if N % s == 0:
  print('Yes')
else:
  print('No')
from collections import Counter
N = int(input())
SS = [input() for _ in range(N)]

STR_IN_S = [[[] for _ in range(11)] for _ in range(26)]

for i in range(N):
  S = SS[i]
  c = Counter(S)
  for j in range(26):
    s = chr(97+j)
    STR_IN_S[j][c[s]].append(i)
    
SAME = [set(range(N)) for _ in range(N)]

for i in range(26):
  for j in range(11):
    l = STR_IN_S[i][j]
	nl = set(l)
    for x in l:
      SAME[x] &= nl
  
ans = 0
for i in range(N):
  ans += len(SAME[i]) - 1
  
print(ans)


### FIXED CODE ###

N = int(input())

SS = []
for i in range(N):
  s = list(input())
  s.sort()
  SS.append(s)
  
SS.sort()

ans = 0
prev = None
cnt = 0
for i in range(N):
  s = SS[i]
  if s == prev:
    if not cnt:
      cnt = 2
    else:
      cnt += 1
  else:
    ans += cnt * (cnt - 1) // 2
    cnt = 0
  prev = s
  
ans += cnt * (cnt - 1) // 2
print(ans)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for b in B:
    a = bisect_left(A, b)
    c = bisect_right(C, b)
    ans += a*(N-c)
print(ans)

### 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.sort()
B.sort()
C.sort()
ans = 0
for b in B:
    i = bisect.bisect_left(A, b)
    j = bisect.bisect_right(C, b)
    ans += i*(N-j)
print(ans)
X = int(input())
b=0
MAX=0
while b<X:
    p=2
    b+=1
    while b**p <= X:
        if b**p > MAX:
            MAX = b**p
            p+=1
print(MAX)

### FIXED CODE ###

a,b,c,d = map(int, input().split())
if abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d):
    print("Yes")
else:
    print("No")
a,b= map(int, input().split())
aa = a + 0.9
bb = b + 0.9

if int(bb/0.1) > 1000:
bb = 1000

aaa = set(range(int(a/0.08),int(aa/0.08)))
bbb = set(range(int(b/0.1), int(bb/0.1)))

x = list(aaa.intersection(bbb))

if len(x) == 0:
  print('-1')
else:
  print(min(x))


### FIXED CODE ###

a,b=map(int,input().split())
for i in  range(1,1300):
  if int(i*0.08)==a and int(i*0.1)==b:
    print(i)
    exit()
print(-1)
import sys
sys.setrecursionlimit(10 ** 7)

#dfs
M = int(input())
L = []
for i in range(M):
    d, c = map(int, input().split())
    L.extend([d] * c)

answer = 0

def dfs(count, l):
    global answer
    if len(l) == 1:
        #print(count)
        answer = max(answer, count)
    else:
        i = -2
        sum = l[i] + l[i+1]
        result = l[:i] + [int(x) for x in list(str(sum))]
        #print(result)
        dfs(count+1, result)

dfs(0, L)
print(answer)


### FIXED CODE ###

import sys
import numpy as np

stdin = sys.stdin
 
ni = lambda:int(ns())
na = lambda:list(map(int,stdin.readline().split()))
ns = lambda:stdin.readline().rstrip()  # ignore trailing spaces

M = ni()
D = [] ; C = []

for i in range(M):
    d, c = na()
    D.append(d)
    C.append(c)

D = np.array(D) ; C = np.array(C)
#桁数の9倍とそれぞれの数字の総和をx
x = C.sum() * 9 + (C * D).sum()
# 18以下で終了
answer = (x + 8) // 9 - 2
print(answer)
A,B,C,D,E,F = map(int,input().split())
f = F//100

per = 0
#水の量を100g単位ずつ全探索
for w in range(1,f+1):
    #そのような水の取り方があるか確認
    wt = 0
    for b in range(0,w+1,B):
        if (w-b)%A == 0:
            wt = 1
            break
    if wt == 0:
        continue

    water = w*100
    sugar = w*E
    #砂糖として考えられる量を大きい順に0gまでに全探索
    for s in range(sugar,-1,-1):
        #そのような砂糖の取り方があるか確認
        st = 0
        for d in range(0,s+1,D):
            if (s-d)%C == 0:
                st = 1
                break
        if st == 1:
            break
    if s+water <= F and s/(s+water) > per:
        ans = [s+water,s]
        per = s/(s+water)

print(' '.join(map(str,ans)))


### FIXED CODE ###

A,B,C,D,E,F = map(int,input().split())
f = F//100

ans = [0,0]
per = -1
#水の量を100g単位ずつ全探索
for w in range(1,f+1):
    #そのような水の取り方があるか確認
    wt = 0
    for b in range(0,w+1,B):
        if (w-b)%A == 0:
            wt = 1
            break
    if wt == 0:
        continue

    water = w*100
    sugar = min(w*E,F-water)
    if ans[0] == 0:
        ans[0] = water
    st = 0
    #砂糖として考えられる量を大きい順に0gまでに全探索
    for s in range(sugar,0,-1):
        st = 0
        for d in range(0,s+1,D):
            if (s-d)%C == 0:
                st = 1
                break
        if st == 1:
            break
    if st == 1 and s+water <= F and s/(s+water) > per:
        ans = [s+water,s]
        per = s/(s+water)

print(' '.join(map(str,ans)))
import math
data = [list(map(int, input().split())) for i in range(n)]
def dist(x, y):
    return math.sqrt(x**2 + y**2)
count = 0
for i in range(n):
    dis = dist(data[i][0], data[i][1])
    if dis <= d:
        count += 1

print(count)


### FIXED CODE ###

import math
n, d = list(map(int, input().split()))
data = [list(map(int, input().split())) for i in range(n)]
def dist(x, y):
    return math.sqrt(x**2 + y**2)


count = 0
for i in range(n):
    dis = dist(data[i][0], data[i][1])
    if dis <= d:
        count += 1

print(count)