Harryxun/stf_run huggingface dataset:
A,B,C,D=list(map(int,input().split()))
def Factoring(value):
    _value=value
    div=2
    data=[]
    while value!=1:
        while value%div==0:
            value=int(value/div)
            data.append(div)
        div+=1
    return(data)
def divcheck(value,lst):
    for i in lst:
        if value%i!=0:
            return(1)
        value=int(value/i)
    return(0)
FactoringC,FactoringD=Factoring(C),Factoring(D)
for i in range(A,B+1):
    if not divcheck(i,FactoringC):
        startC=i
        break
for i in range(A,B+1):
    if not divcheck(i,FactoringD):
        startD=i
        break
print(B+1-A-len(set(list(range(startC,B+1,C))+list(range(startD,B+1,D)))))


### FIXED CODE ###

from fractions import Fraction ,gcd
def lcm(a,b):
    return(a*b//gcd(a,b))
A,B,C,D=map(int,input().split())
N=B-A+1
ans=N- (B//C + B//D - (A-1)//C - (A-1)//D) + B//(lcm(C,D)) -(A-1)//(lcm(C,D))
print(ans)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
ls = list(S)
ls = [int(x) for x in ls]
offset = 0
count = 0
while True:
    if ls[offset] == ls[offset +1]:
        del ls[offset:offset +2]
        count += 2
    elif offset +1 ==len(ls):
        break

    else:
        offset += 1

print(count)

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
ls = list(S)
ls = [int(x) for x in ls]

ans = min(ls.count(0),ls.count(1))
print(ans*2)
n = int(input())
a_l = list(map(int, input().split()))
a_l.sort()
b_l = list()

length = len(a_l)
k = 0
for i in range(length):
  if a_l[i] < 0:
    k = i
  else:
    break

b_l = a_l[:k+1]
a_l = a_l[k+1:]
fu = len(b_l)
sei = len(a_l)
ans_l = list()
ans_ll = list()
if sei > fu:
  sa = sei-fu-1
  ans_ll.append(a_l[-1])
  for i in range(fu):
    ans_l.append([b_l[i], a_l[-i-2]])
    ans_ll.append(b_l[i]-a_l[-i-2])
  aa_l = a_l[:sa]
  aa = 0
  for i in range(len(aa_l)-1):
    ans_l.append([aa_l[i], aa_l[i+1]])
    aa = aa_l[i] - aa_l[i+1]
  ans_ll.append(aa)
  ans_ll.sort()
  lent = len(ans_ll)
  for i in range(lent-1):
    ans_l.append([ans_ll[-1], ans_ll[i]])
    ans_ll[-1] = ans_ll[-1]-ans_ll[i]
elif sei < fu:
  sa = fu-sei+1
  if len(a_l) != 0:
    ans_ll.append(a_l[-1])
  b_l = b_l[sa:]
  for i in range(len(b_l)):
    ans_l.append([b_l[i], a_l[-i-2]])
    ans_ll.append(b_l[i]-a_l[-i-2])
  bb_l = b_l[:sa]
  bb_l.reverse()
  aa = 0
  for i in range(len(aa_l)-1):
    ans_l.append([aa_l[i], aa_l[i+1]])
    aa = aa_l[i] - aa_l[i+1]
  ans_ll.append(aa)
  ans_ll.sort()
  lent = len(ans_ll)
  for i in range(lent-1):
    ans_l.append([ans_ll[-1], ans_ll[i]])
    ans_ll[-1] = ans_ll[-1]-ans_ll[i]c
else:
  for i in range(sei):
    if i == 0:
      ans_l.append([a_l[-i-1], b_l[i]])
      ans_ll.append(a_l[-i-1]-b_l[i])
    else:
      ans_l.append([b_l[i], a_l[-i-1]])
      ans_ll.append(b_l[i]-a_l[-i-1])
  ans_ll.sort()
  lent = len(ans_ll)  
  for i in range(lent-1):
    ans_l.append([ans_ll[-1], ans_ll[i]])
    ans_ll[-1] = ans_ll[-1]-ans_ll[i]
    
ans_length = len(ans_l)
print(ans_ll[-1])
for i in range(ans_length):
  a = ans_l[i][0]
  b = ans_l[i][1]
  print(a, b)
  
    
                 
    
    
    
  


### FIXED CODE ###

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

length = len(a_l)
k = 0
for i in range(length):
  if a_l[i] < 0:
    k = i
  else:
    break

b_l = a_l[:k+1]
if len(b_l) != 0:
  min_b = b_l[0]
a_l = a_l[k+1:]
if len(a_l) != 0:
  max_a = a_l[-1]
fu = len(b_l)
sei = len(a_l)
ans_l = list()
ans_n_l = list()
if len(b_l) != 0:
  if len(a_l) != 0:
    for i in range(1, fu):
      ans_l.append([max_a, b_l[i]])
      max_a -= b_l[i]
    for i in range(sei-1):
      ans_l.append([min_b, a_l[i]])
      min_b -= a_l[i]
    
    ans_l.append([max_a, min_b])
    max_a -= min_b
  else:
    max_a = b_l[-1]
    for i in range(1, fu-1):
      ans_l.append([max_a, b_l[i]])
      max_a -= b_l[i]
    ans_l.append([max_a, min_b])
    max_a -= min_b
else:
  min_b = a_l[0]
  for i in range(1, sei-1):
    ans_l.append([min_b, a_l[i]])
    min_b -= a_l[i]
  ans_l.append([max_a, min_b])
  max_a -= min_b
  
print(max_a)
for i in ans_l:
  print(i[0], i[1])
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n,k = map(int, input().split())
s = input().rstrip()

li = []
fi = int(s[0])
cnt = 1
for i in range(1, n):
    if s[i-1] == s[i]:
        cnt += 1
    else:
        li.append(cnt)
        cnt = 1
li.append(cnt)

sums = [0] * (len(li)+1)
for i in range(0,len(li)):
    sums[i+1] = li[i] + sums[i]

ans = 0
ma = k*2+1 if fi == 1 else k*2
nn = max(1, len(sums) - ma)
for i in range(nn, len(sums)):
    sum = sums[i] - sums[i-ma]
    ans = max(ans, sum)

print(ans)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n,k = map(int, input().split())
s = input()

ans = 0
cnt = 0
right = 1
for left in range(0, n):
    if left == 0 and s[left] == '0':
        cnt += 1

    if left > 0 and s[left] == '1' and s[left-1] == '0':
        cnt -= 1

    while right <= n - 1:
        if s[right] == '0' and s[right-1] == '1':
            if cnt < k:
                cnt += 1
            else:
                break
        right += 1

    ans = max(ans, right - left)

print(ans)
import numpy as np
 
N, K = map(int, input().split())
new_list_f = sorted(list(map(int, input().split())))
new_list_a = sorted(list(map(int, input().split())), reverse=True)
 
new_list_f = np.array(new_list_f)
new_list_a = np.array(new_list_a)
time = new_list_f * new_list_a
 
for i in range(K + 1):
  t_max = time.index(max(time))
  new_list_a[t_max] = new_list_a[t_max] - (i - (i - 1))
  if new_list_a[t_max] == 0:
    break
  
print(time)

### FIXED CODE ###

import numpy as np

import sys
input = sys.stdin.buffer.readline

N, K = map(int, input().split())
A = np.array(input().split(), np.int64)
F = np.array(input().split(), np.int64)

A.sort()
F.sort()

F= F[::-1]

left = -1
right = (A * F).sum()
while left + 1 < right:
  middle = (left + right) // 2
  right_arr = np.maximum(0, A - middle // F).sum() <= K
  if right_arr:
    right = middle
  else:
    left = middle
print(right)
W, H, x, y = map(int, input().split())
flag = 1 if x == W/2 and y == H/2 else 0
print(f"{W*H/2} {flag}")

### FIXED CODE ###

W, H, x, y = map(int, input().split())
flag = 1 if x == W/2 and y == H/2 else 0
print("{0} {1}".format(W*H/2, flag))
n,k=map(int,input().split())
d=list(input().split())
x=list(range(1,10000)[::-1])
for i in d:
  a=[]
  for j in x:
    if i not in str(j):
      a.append(j)
  x=a
import bisect as bi
print(x[bi.bisect_left(x,n)])

### FIXED CODE ###

n,k=map(int,input().split())
d=list(input().split())
x=list(range(1,100000)[::-1])
for i in d:
  a=[]
  for j in x:
    if i not in str(j):
      a.append(j)
  x=a
import bisect as bi
x=x[::-1]
print(x[bi.bisect_left(x,n)])
n = int(input())

ascii = 'abcdefghijklmnopqrstuvwxyz'

out = ''
l = []
while n > 0:
    l.append(n%26)
    out = str(n%26) + ", " + out
    n = int(n/26)
# print(out)
# print(l)

flg = 0
for i in range(len(l)):
    if l[i] != 0:
        l[i] -= 1
    else:
        if i == len(l)-2:
            flg = 1
        l[i+1] = 0
        l[i] = 25

if len(l)==1:
    l[0] -= 1

name = ""
for i in range(len(l)-flg):
    name = ascii[l[i]] + name
print(name)


### FIXED CODE ###

n = int(input())

# # 名前の長さを求める
i = 1
while 1:
    # print(i)
    if n <= 26 ** i:
        break
    else:
        n -= 26**i
    i += 1

name = ""
n -= 1
for j in range(i):
    name += chr(ord('a') + n % 26)
    n //= 26

print(name[::-1])
S = list(input())
K = int(input())
if not S[0] == "1":
    print(S[0])
else:
    print(S[1])


### FIXED CODE ###

def searchInf(s, k):
    l = k if len(s) >= k else len(s)
    for i in range(l):
        if s[i] == "1":
            continue
        else:
            print(s[i])
            return 0
    print(1)
    return 0


S = list(input())
K = int(input())
searchInf(S, K)
def change(x):
	res = 1000 - x%1000
    if res:
      return res
    return 0

### FIXED CODE ###

n = int(input())
ans = (1000 - (n % 1000)) % 1000
print(ans)
import math
n = int(input())
h = list(map(int,input().split(' ')))
'''
n-=1
inf = int(1e9+5)

dp = {}
def frog1(i):
    if i==n:
        return 0
    if i in dp:
        return dp[i]
    
    a = 0
    b = 0
    if i+1>n:
        a = inf
    else:
        a = frog1(i+1)+abs(h[i]-h[i+1])

    if i+2>n:
        b = inf
    else:
        b = frog1(i+2)+abs(h[i]-h[i+2])
    dp[i] = min(a,b)
    return dp[i]
'''
def solve(n,h):
    dp = [0]*n
    for i in reversed(range(0,n-1)):
        if i==n-1:
            dp[i] = 0
        else:
            a = 0
            b = 0
            if i+1>n-1:
                a = math.inf
            else:
                a = dp[i+1]+abs(h[i]-h[i+1])
            if i+2>n-1:
                b = math.inf
            else:
                b = dp[i+2]+abs(h[i]-h[i+2])
            dp[i] = min(a,b)
    return dp[0]
print(solve(n,h))


### FIXED CODE ###

import math
n = int(input())
h = list(map(int,input().split(' ')))
'''
n-=1
inf = int(1e9+5)

dp = {}
def frog1(i):
    if i==n:
        return 0
    if i in dp:
        return dp[i]
    
    a = 0
    b = 0
    if i+1>n:
        a = inf
    else:
        a = frog1(i+1)+abs(h[i]-h[i+1])

    if i+2>n:
        b = inf
    else:
        b = frog1(i+2)+abs(h[i]-h[i+2])
    dp[i] = min(a,b)
    return dp[i]
'''
def solve(n,h):
    dp = [0]*n
    for i in reversed(range(0,n-1)):
        if i==n-1:
            dp[i] = 0
        else:
            if i==n-2:
                dp[i] = abs(h[n-1]-h[n-2])
                continue
            a = 0
            b = 0
            if i+1<=n-1:
                a = dp[i+1]+abs(h[i]-h[i+1])
            if i+2<=n-1:
                b = dp[i+2]+abs(h[i]-h[i+2])  
            dp[i] = min(a,b)
    return dp[0]
print(solve(n,h))
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    maxa=2*10**5
    isprime=[True]*(maxa+1)
    sa=sorted(a)

    prevx=0
    for x in sa:
        if isprime[x]==False:
            continue
        if prevx==x:
            isprime[x]=False
            continue

        i=x*2
        while(i<=maxa):
            isprime[i]=False
            i+=x
        prevx=x
    
    count=0
    for x in sa:
        if isprime[x]==True:
            count+=1
    return count

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)


### FIXED CODE ###

def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    maxa=10**6
    isprime=[True]*(maxa+1)
    sa=sorted(a)

    prevx=0
    for x in sa:
        if isprime[x]==False:
            continue
        if prevx==x:
            isprime[x]=False
            continue

        i=x*2
        while(i<=maxa):
            isprime[i]=False
            i+=x
        prevx=x
    
    count=0
    for x in sa:
        if isprime[x]==True:
            count+=1
    return count

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)
import math
def combinations(n ,r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
n, m = map(int, input().split())
print(combinations(n, 2) + combinations(m , 2))

### FIXED CODE ###

n, m = map(int, input().split())
print(n*(n-1)//2 + m*(m-1)//2)
n = int(input())
mountain = [ s for s in input().split(" ")]
highest = 0
ans = 0

for m in mountain:
  if m >= highest:
    ans += 1
    highest = m

print(ans)

### FIXED CODE ###

n = int(input())
mountain = [ int(s) for s in input().split(" ")]
ans = 0
highest = 0

for m in mountain:
    if m >= highest:
        ans += 1
        highest = m

print(ans)
K = int (input())
S = (input())
if len(S) <= K:
    print(S)
else:
    print(S[:K] + '...'

### FIXED CODE ###

K = int (input())
S = (input())
if len(S) <= K:
    print(S)
else:
    print(S[:K] + '...')
mod = 10**9+7
N,K = map(int,input().split())
A = list(map(int,input().split()))
canPositive = 0
Positive = 0
ans = 1
def inv(arg):
    return pow(arg,mod-2,mod)
for i in range(N):
    if A[i] >= 0:
        Positive += 1
if N - K >= 1 and Positive >= 1:
    canPositive = 1
if Positive == 0 and K % 2 == 0:
    canPositive = 1
anslist = []
if canPositive:
    A.sort(key=lambda x:abs(x),reverse=True)
    n = 0
    for a in A[:K]:
        anslist.append(a)
        if a < 0:
           n += 1
    if n % 2 == 1:
        minpos = 0
        minneg = 0
        maxpos = 0
        minneg = 0
        for i in anslist[::-1]:
            if i > 0:
                minpos = i
                break
        for i in anslist[::-1]:
            if i < 0:
                minneg = i
                break
        for i in A[K:]:
            if i < 0:
                maxneg = i
                break
        for i in A[K:]:
            if i > 0:
                maxpos = i
                break
        if abs(minpos*maxpos) > abs(maxneg*minneg):
            ans *= maxpos*inv(minneg)
        else:
            ans *= maxneg*inv(minpos)
else:
    A.sort(key=lambda x:abs(x))
    for a in A[:K]:
        anslist.append(a)
for i in anslist:
    ans *= i
    ans %= mod
print(ans)

### FIXED CODE ###

mod = 10**9+7
N,K = map(int,input().split())
A = list(map(int,input().split()))
canPositive = 0
Positive = 0
ans = 1
def inv(arg):
    return pow(arg,mod-2,mod)
for i in range(N):
    if A[i] >= 0:
        Positive += 1
if N - K >= 1 and Positive >= 1:
    canPositive = 1
if Positive == 0 and K % 2 == 0:
    canPositive = 1
anslist = []
if canPositive:
    A.sort(key=lambda x:abs(x),reverse=True)
    n = 0
    for a in A[:K]:
        anslist.append(a)
        if a < 0:
           n += 1
    if n % 2 == 1:
        minpos = 0
        minneg = 0
        maxpos = 0
        maxneg = 0
        for i in anslist[::-1]:
            if i > 0:
                minpos = i
                break
        for i in anslist[::-1]:
            if i < 0:
                minneg = i
                break
        for i in A[K:]:
            if i < 0:
                maxneg = i
                break
        for i in A[K:]:
            if i > 0:
                maxpos = i
                break
        if maxneg == 0 or minpos == 0:
            ans *= maxpos*inv(minneg) 
        elif maxpos == 0 or minneg == 0:
            ans *= maxneg*inv(minpos) 
        else:
            if abs(minpos*maxpos) > abs(maxneg*minneg):
                ans *= maxpos*inv(minneg) 
            else:
                ans *= maxneg*inv(minpos) 
else:
    A.sort(key=lambda x:abs(x))
    for a in A[:K]:
        anslist.append(a)
for i in anslist:
    ans *= i
    ans %= mod
print(ans)
a,b=input().split()
M=max(a,b)
m=min(a,b)

n=0
n+=M
M-=1

n+=max(M,m)

print(n)

### FIXED CODE ###

a,b=map(int,input().split())
M=max(a,b)
m=min(a,b)

n=0
n+=M
M-=1

n+=max(M,m)

print(n)
def s(p,A,B):b=lambda i:(A[i]and B[i])and s(p,A[i],B[i])or p==u and(A[i]or B[i])or 0;return(b(0),b(1))
try:
 while 1:g=_,i,u=raw_input().split();print`s(*map(lambda s:eval(s.replace("(,","(0,").replace(",)",",0)")),g))`.replace(" ","").replace("0","")
except:pass

### FIXED CODE ###

def convert(s):
    cur = [0]
    def dfs():
        result = [0, 0]
        cur[0] += 1 # '('
        if s[cur[0]] == '(':
            result[0] = dfs()
        cur[0] += 1 # ','
        if s[cur[0]] == '(':
            result[1] = dfs()
        cur[0] += 1 # ')'
        return result
    return dfs()
def rconvert(C):
    def dfs(node):
        res = ["", ""]
        if node[0]:
            res[0] = rconvert(node[0])
        if node[1]:
            res[1] = rconvert(node[1])
        return "(%s,%s)" % tuple(res)
    return dfs(C)
def solve(A, B, t):
    def get(i):
        if A[i] and B[i]:
            return solve(A[i], B[i], t)
        elif t is 'u':
            return A[i] or B[i]
    return [get(0), get(1)]
try:
    while 1:
        ipt = raw_input().split()
        print rconvert(solve(convert(ipt[1]), convert(ipt[2]), ipt[0]))
except:pass
n = int(input())
edges = [[]for _ in range(n)]
for _ in range(n-1):
    a, b = map(lambda x: int(x)-1, input().split())
    edges[a].append(b)
    edges[b].append(a)


cost = sorted(map(int, input().split()), reverse=True)

priority = [(len(edge), v) for v, edge in enumerate(edges)]
priority.sort(reverse=True)
ans = [None]*n
while priority:
    d, v = priority.pop()
    c = cost.pop()
    ans[v] = c

m = 0


def dfs(v, parent):
    if parent != -1:
        global m
        m += min(ans[v], ans[parent])

    for v2 in edges[v]:
        if v2 == parent:
            continue
        dfs(v2, v)


dfs(0, -1)
print(m)
print(*ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
n = int(input())
edges = [[]for _ in range(n)]
for _ in range(n-1):
    a, b = map(lambda x: int(x)-1, input().split())
    edges[a].append(b)
    edges[b].append(a)


cost = sorted(map(int, input().split()))
m = 0
ans = [None]*n


def dfs(v, parent):
    ans[v] = cost.pop()
    if parent != -1:
        global m
        m += min(ans[v], ans[parent])
    for v2 in edges[v]:
        if v2 == parent:
            continue
        dfs(v2, v)


dfs(0, -1)
print(m)
print(*ans)
n, m = map(int, input().split())
import sys
s = []
c = []
d = [-1] * n
for _ in range(m):
    i, j = map(int, input().split())
    if i == 1 and j == 0:
        print(-1)
        sys.exit()
    if d[i-1] == -1 or d[i-1] == j:
        d[i-1] = j
    else:
        print(-1)
        sys.exit()
    s.append(i)
    c.append(j)

if max(s) > n:
    print(-1)
    sys.exit()
else:
    for i, j in enumerate(d):
        if j == -1:
            if i == 0:
                continue
            else:
                d[i] = 0
print(*d, sep='')

### FIXED CODE ###

import sys
n, m = map(int, input().split())
d = [10] * n
if m == 0:
    if n == 1:
        print(0)
        sys.exit()
    else:
        print('1' + (n - 1) * '0')
        sys.exit()
for _ in range(m):
    s, c = map(int, input().split())
    s = s - 1
    if d[s] == 10:
        d[s] = c
    elif d[s] != c:
        print(-1)
        sys.exit()
if d[0] == 0:
    if n == 1:
        print(0)
        sys.exit()
    else:
        print(-1)
        sys.exit()
if d[0] == 10:
    d[0] = 1
for i in d:
    print(0, end='') if i == 10 else print(i, end='')
def dfs(vertex):
  visited[vertex] = True
  if vertex != 0:
    maxlen = 0
    x = a[vertex]
    for (L, z) in table:
      if z < x: # strict increasing
        maxlen = max(maxlen, L)
    table.append((maxlen+1, x))
  ans[vertex] = max(L for (L, _) in table)
  for node in adjacent[vertex]:
    if not visited[node]:
      dfs(node)
  table.pop()
  return
n = int(input())
a = list(map(int, input().split()))
adjacent = {i: [] for i in range(n)}
for _ in range(n-1):
  node1, node2 = map(int, input().split())
  node1 -= 1
  node2 -= 1
  adjacent[node1].append(node2)
  adjacent[node2].append(node1)
visited = [False]*n
ans = [0]*n
table = [(1, a[0])]
dfs(0)
[print(value) for value in ans]

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
from bisect import bisect, bisect_left
def longest_subsequence(sequence):
  subsequence = [float("inf") for _ in range(len(sequence)+1)]
  subsequence[0] = float("-inf")
  for value in sequence:
    j = bisect(subsequence, value)
    if subsequence[j-1] != value: # strict increasing
      subsequence[j] = value
  return bisect_left(dp, float("inf"))-1
# print(longest_subsequence([9, 13, 2, 10, 4, 13, 11, 13]))
# sys.exit()
def dfs(vertex):
  visited[vertex] = True
  value = a[vertex]
  j = bisect(subsequence, value)
  previous = subsequence[j]
  if subsequence[j-1] != value: # strict increasing
    subsequence[j] = value
  ans[vertex] = bisect_left(subsequence, float("inf"))-1
  for node in adjacent[vertex]:
    if not visited[node]:
      dfs(node)
  subsequence[j] = previous
  return
n = int(input())
a = list(map(int, input().split()))
adjacent = {i: [] for i in range(n)}
for _ in range(n-1):
  node1, node2 = map(int, input().split())
  node1 -= 1
  node2 -= 1
  adjacent[node1].append(node2)
  adjacent[node2].append(node1)
visited = [False]*n
ans = [0]*n
subsequence = [float("inf") for _ in range(n+1)]
subsequence[0] = float("-inf")
dfs(0)
[print(value) for value in ans]
def gcd(x,y):
    x,y = max(x,y),min(x,y)
    while(y>0):
        x,y = y,x%y
    print(x)
def lcm(a,b):
    return(int(a*b/gcd(a,b)))

n = int(input())
a = list(map(int,input().split()))
least_common_multiple = 1
for i in range(n):
    least_common_multiple = lcm(least_common_multiple,a[i])
ans = 0
for i in range(n):
    ans += (least_common_multiple-1)%a[i]
print(ans)

### FIXED CODE ###

import numpy as np
n = int(input())
a = np.array(list(map(int,input().split())))-1
print(a.sum())
y,m,d = list(map(int, input().split("/")))

if y < 2019 or (y =2019 and m <=4):
  print(Heisei)
else:
  print(TBD)

### FIXED CODE ###

y,m,d = list(map(int, input().split("/")))

if y < 2019:
  print(Heisei)
elif y ==2019 and m <=4:
  print("Heisei")
else:
  print("TBD")
n, k = map(int, input().split())
h = list(map(int,input().split()))
oppai = 0
for i in range n:
  if h[i] >= k:
    oppai += 1
print(oppai)
    

### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int,input().split()))
oppai = 0
for i in range (n):
  if h[i] >= k:
    oppai += 1
print(oppai)
n = input()
 
def scalar(n):
   m = [[for i in range(0, len(n))] for j in range(0, len(n))]
 
   for l in range(2, len(n)):
      for i in range(0, len(n)):
         j = i + l - 1
         m[i][j] = min(m[i][k] + m[k+1][j] + M[i][0]*M[k][1]*M[j][1] for k in range(i, j))
 
   print m[0][len(n)-1]
 
for i in range(n):
   M.append(map(int, raw_input().split()))
scalar(M)
 

### FIXED CODE ###

n = input()
M = []
 
def scalar(n):
   m = [[0 for i in range(len(n))] for j in range(len(n))]
 
   for l in range(2, len(n)+1):
      for i in range(0, len(n)-l+1):
         j = i + l - 1
         m[i][j] = min(m[i][k] + m[k+1][j] + M[i][0]*M[k][1]*M[j][1] for k in range(i, j))
 
   print m[0][len(n)-1]
 
for i in range(n):
   M.append(map(int, raw_input().split()))
scalar(M)
n = int(input()
s, t = list(input().split()
ans = []
for i in range(n):
  ans += s[i]
  ans += t[i]

print(ans)

### FIXED CODE ###

n = int(input())
s, t = list(input().split())
ans = ""
for i in range(n):
  ans += s[i]
  ans += t[i]

print(ans)
N, M = map(int, input().split())
G = [[] for _ in range(M)]
res = [""] * M
for i in range(M):
    p, y = map(int, input().split())
    G[p - 1].append((y, i))

for i, g in enumerate(G):
    l = len(str(i + 1))
    g.sort()
    for j, gg in enumerate(g):
        ll = len(str(j + 1))
        res[gg[1]] = "0" * (6 - l) + str(i + 1) + "0" * (6 - ll) + str(j + 1)

print("\n".join(res))


### FIXED CODE ###

N, M = map(int, input().split())
G = [[] for _ in range(N)]
res = [""] * M
for i in range(M):
    p, y = map(int, input().split())
    G[p - 1].append((y, i))

G = list(map(sorted, G))
for p in range(N):
    for m, (y, i) in enumerate(G[p], 1):
        res[i] = 10 ** 12 + (p + 1) * 10 ** 6 + m

for r in res:
    print(str(r)[1:])
N, M = map(int, input().split())
Edge = [[]for _ in range(N)]
Far = [-1]*N
for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    Edge[x].append(y)


def long(x):
    if len(Edge[x]) == 0:
        Far[x] = 0
        return 0
    if Far[x] >= 0:
        return Far[x]
    r = 0
    for i in Edge[x]:
        l = long(i) + 1
        r = max(r, l)
    Far[x] = r
    return r


for i in range(N):
    long(i)
print(max(Far))




### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N, M = map(int, input().split())
Edge = [[]for _ in range(N)]
Far = [-1]*N
for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    Edge[x].append(y)


def long(x):
    if len(Edge[x]) == 0:
        Far[x] = 0
        return 0
    if Far[x] >= 0:
        return Far[x]
    r = 0
    for i in Edge[x]:
        l = long(i) + 1
        r = max(r, l)
    Far[x] = r
    return r


for i in range(N):
    long(i)
print(max(Far))