Mishka started participating in a programming contest. There are $n$ problems in the contest. Mishka's problem-solving skill is equal to $k$.

Mishka arranges all problems from the contest into a list. Because of his weird principles, Mishka only solves problems from one of the ends of the list. Every time, he chooses which end (left or right) he will solve the next problem from. Thus, each problem Mishka solves is either the leftmost or the rightmost problem in the list.

Mishka cannot solve a problem with difficulty greater than $k$. When Mishka solves the problem, it disappears from the list, so the length of the list decreases by $1$. Mishka stops when he is unable to solve any problem from any end of the list.

How many problems can Mishka solve?


-----Input-----

The first line of input contains two integers $n$ and $k$ ($1 \le n, k \le 100$) — the number of problems in the contest and Mishka's problem-solving skill.

The second line of input contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 100$), where $a_i$ is the difficulty of the $i$-th problem. The problems are given in order from the leftmost to the rightmost in the list.


-----Output-----

Print one integer — the maximum number of problems Mishka can solve.


-----Examples-----
Input
8 4
4 2 3 1 5 1 6 4

Output
5

Input
5 2
3 1 2 1 3

Output
0

Input
5 100
12 34 55 43 21

Output
5



-----Note-----

In the first example, Mishka can solve problems in the following order: $[4, 2, 3, 1, 5, 1, 6, 4] \rightarrow [2, 3, 1, 5, 1, 6, 4] \rightarrow [2, 3, 1, 5, 1, 6] \rightarrow [3, 1, 5, 1, 6] \rightarrow [1, 5, 1, 6] \rightarrow [5, 1, 6]$, so the number of solved problems will be equal to $5$.

In the second example, Mishka can't solve any problem because the difficulties of problems from both ends are greater than $k$.

In the third example, Mishka's solving skill is so amazing that he can solve all the problems.

Source: codeforces | Difficulty: EASY
Tags: Implementation

Complete search


Solutions:
(n, k) = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for i in range(n):
	if A[i] > k:
		break
	else:
		ans += 1
if i != n - 1:
	for j in range(n - 1, -1, -1):
		if A[j] > k:
			break
		else:
			ans += 1
print(ans)


(a, b) = map(int, input().split())
problems = [int(i) for i in input().split()]
count = 0
for i in range(a):
	if problems[i] > b:
		break
	else:
		count += 1
if count == a:
	print(a)
else:
	problems.reverse()
	for i in range(a):
		if problems[i] > b:
			break
		else:
			count += 1
	print(count)


import sys
(n, k) = map(int, sys.stdin.readline()[:-1].split(' '))
a = list(map(int, sys.stdin.readline()[:-1].split(' ')))
res = 0
i = 0
while i < n and a[i] <= k:
	res += 1
	i += 1
if i < n:
	i = n - 1
	while i >= 0 and a[i] <= k:
		res += 1
		i -= 1
print(res)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
i = 0
while i < n and a[i] <= k:
	i += 1
	cnt += 1
j = n - 1
while j >= i and a[j] <= k:
	j -= 1
	cnt += 1
print(cnt)


(n, k) = map(int, input().split())
L = list(map(int, input().split()))
res = 0
while n != 0 and L[0] <= k:
	L.pop(0)
	res += 1
	n -= 1
while n != 0 and L[n - 1] <= k:
	L.pop()
	res += 1
	n -= 1
print(res)


tc = list(map(int, input().split()))
store = list(map(int, input().split()))
numOfSolved = 0
i = 0
for i in range(len(store)):
	if store[i] <= tc[1]:
		numOfSolved += 1
	else:
		break
for i in range(len(store) - 1, i, -1):
	if store[i] <= tc[1]:
		numOfSolved += 1
	else:
		break
print(numOfSolved)


nk = list(map(int, input().split()))
n = nk[0]
k = nk[1]
m = list(map(int, input().split()))
ans = 0
for i in range(n - 1, -1, -1):
	if m[i] <= k:
		ans += 1
		m.pop()
	else:
		break
m.reverse()
for i in range(len(m) - 1, -1, -1):
	if m[i] <= k:
		ans += 1
		m.pop()
	else:
		break
print(ans)


(n, k) = map(int, input().split())
res = 0
cur_res = 0
first = True
for a in map(int, input().split()):
	if a <= k:
		cur_res += 1
	else:
		if first:
			res = cur_res
			first = False
		cur_res = 0
print(res + cur_res)


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
if max(arr) <= k:
	print(n)
else:
	temp = arr.copy()
	temp.reverse()
	count_ = 0
	for i in arr:
		if i <= k:
			count_ += 1
		else:
			break
	for i in temp:
		if i <= k:
			count_ += 1
		else:
			break
	print(count_)


l = input().split()
n = int(l[0])
k = int(l[1])
l = input().split()
li = [int(i) for i in l]
count = 0
while li != []:
	if li[0] <= k:
		count += 1
		li.pop(0)
	elif li[-1] <= k:
		count += 1
		li.pop(-1)
	else:
		break
print(count)


(n, m) = map(int, input().split())
count = 0
li = list(map(int, input().split()))
(i, j) = (0, n - 1)
while i < n:
	if li[i] <= m:
		count += 1
		i += 1
	elif li[j] <= m:
		count += 1
		j = j - 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
(ans1, ans2) = (0, 0)
for i in range(n):
	if a[i] <= k:
		ans1 += 1
	else:
		break
if ans1 == n:
	print(ans1)
else:
	for i in range(n - 1, -1, -1):
		if a[i] <= k:
			ans2 += 1
		else:
			break
	print(ans1 + ans2)


(n, k) = map(int, input().split())
a = [int(m) for m in input().split()]
i = 0
ans = 0
while i < n and a[i] <= k:
	ans += 1
	i += 1
j = n - 1
if i != n:
	while a[j] <= k:
		j -= 1
		ans += 1
print(ans)


(n, k) = map(int, input().split())
ar = list(map(int, input().split()))
i = 0
j = -1
cnt = 0
while cnt < n and (ar[i] <= k or ar[j] <= k):
	if ar[i] <= k:
		i += 1
	else:
		j -= 1
	cnt += 1
print(cnt)


from collections import deque
import sys
(n, k) = map(int, sys.stdin.readline().split())
p = deque(map(int, sys.stdin.readline().split()))
solved = 0
for i in range(n):
	if p[0] <= k:
		solved += 1
		p.popleft()
	elif p[-1] <= k:
		solved += 1
		p.pop()
print(solved)


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
c = 0
while True:
	if len(arr) == 0:
		break
	if arr[0] > k:
		break
	arr.pop(0)
	c += 1
while True:
	if not arr:
		break
	if arr[-1] > k:
		break
	arr.pop()
	c += 1
print(c)


(n, k) = map(int, input().split())
lis = list(map(int, input().split()))
(left, right) = (0, 0)
for i in lis:
	if i <= k:
		left += 1
	else:
		break
for i in range(len(lis) - 1, 0, -1):
	if lis[i] <= k:
		right += 1
	else:
		break
print(min(n, left + right))


(n, k) = input().split(' ')
n = int(n)
k = int(k)
c = input().split(' ', n)
c = list(map(int, c))
h = 0
l = 0
i = 0
while i < n:
	if k > c[i] or k == c[i]:
		h += 1
		l = i
		i += 1
	else:
		l = i
		break
j = n - 1
while j > l:
	if k > c[j] or k == c[j]:
		h += 1
		j -= 1
	else:
		break
print(h)


n = list(map(int, input().split()))
a = list(map(int, input().split()))
(i, j, count) = (0, n[0] - 1, 0)
while a[i] <= n[1]:
	i += 1
	count += 1
	if i == n[0]:
		print(count)
		exit()
while a[j] <= n[1]:
	j -= 1
	count += 1
	if j == -1:
		print(count)
		exit()
print(count)


a = list(map(int, input().split(' ')))
n = a[0]
k = a[1]
b = list(map(int, input().split(' ')))
c = 0
for i in range(0, n):
	if b[i] <= k:
		c = c + 1
	else:
		break
if c < n:
	for j in range(n - 1, 0, -1):
		if b[j] <= k:
			c = c + 1
		else:
			break
print(c)


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
sol = 0
while len(arr) > 0 and (arr[0] <= k or arr[-1] <= k):
	if arr[0] <= k:
		arr = arr[1:]
	else:
		arr = arr[:-1]
	sol += 1
print(sol)


(tn, tk) = input().split()
n = int(tn)
k = int(tk)
a = input().split()
ans = 0
for i in range(n):
	if int(a[i]) > k:
		break
	ans += 1
for i in range(n - 1, -1, -1):
	if int(a[i]) > k:
		break
	ans += 1
if ans > n:
	ans = n
print(ans)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
nb = 0
for i in range(len(a)):
	if a[0] <= k or a[len(a) - 1] <= k:
		nb += 1
		if a[0] <= k:
			del a[0]
		else:
			del a[len(a) - 1]
	else:
		break
print(nb)


[n, k] = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]
if max(L) <= k:
	print(len(L))
else:
	c = 0
	for i in range(len(L)):
		if L[i] <= k:
			c += 1
		else:
			break
	for i in range(1, len(L) + 1):
		if L[-i] <= k:
			c += 1
		else:
			break
	print(c)


(n, k) = list(map(int, input().split()))
l = list(map(int, input().split()))
j = 0
while l != []:
	if l[0] > k and l[-1] > k:
		print(j)
		break
	if l[0] <= k:
		l.pop(0)
		j += 1
	elif l[-1] <= k:
		l.pop()
		j += 1
if j == n:
	print(n)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
solved = 0
for i in range(0, len(a)):
	if a[i] <= k:
		solved += 1
		a[i] = 1000000
	else:
		break
for i in range(len(a) - 1, 0, -1):
	if a[i] <= k:
		solved += 1
		a[i] = 1000000
	else:
		break
print(solved)


(n, k) = [int(a) for a in input().split()]
as_ = [int(a) for a in input().split()]
i = 0
while i < n and as_[i] <= k:
	i += 1
j = n - 1
while i <= j and as_[j] <= k:
	j -= 1
print(n - j + i - 1)


nk = list(map(int, input().split()))
a = list(map(int, input().split()))
tasks = 0
while len(a) >= 1 and (a[0] <= nk[1] or a[len(a) - 1] <= nk[1]):
	if a[0] <= nk[1]:
		a.pop(0)
	elif a[len(a) - 1] <= nk[1]:
		a.pop()
	tasks += 1
print(tasks)


(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
cnt = 0
for i in range(n):
	if a[i] <= k:
		cnt += 1
	elif a[i] > k:
		break
if cnt < n:
	for i in reversed(a):
		if i <= k:
			cnt += 1
		elif i > k:
			break
print(cnt)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
c = 0
for i in range(len(a)):
	if a[i] <= k:
		c += 1
	else:
		break
for i in range(len(a) - 1, -1, -1):
	if a[i] <= k:
		c += 1
	else:
		break
print(min(c, len(a)))


(n, k) = map(int, input().split())
p = list(map(int, input().split()))
c = 0
while len(p) > 0 and (p[0] <= k or p[-1] <= k):
	if p[0] <= k:
		del p[0]
		c += 1
	if len(p) > 0:
		if p[-1] <= k:
			del p[-1]
			c += 1
print(c)


(n, k) = input().split()
n = int(n)
k = int(k)
arr = input().split(' ')
for i in range(n):
	arr[i] = int(arr[i])
count = 0
tempn = n - 1
while True:
	if tempn < 0:
		break
	elif arr[0] <= k:
		count = count + 1
		tempn = tempn - 1
		del arr[0]
	elif arr[tempn] <= k:
		count = count + 1
		del arr[tempn]
		tempn = tempn - 1
	else:
		break
print(count)


(n, k) = map(int, input().split(' '))
print(n - len(''.join(('x '[int(v) <= k] for v in input().split())).strip()))


def a(A, k):
	L = len(A)
	if L == 0:
		return A
	elif A[0] <= k:
		return a(A[1:], k)
	if A[L - 1] <= k:
		return a(A[:L - 1], k)
	else:
		return A

def sol():
	(n, k) = map(int, input().split())
	A = [int(item) for item in input().split()]
	print(n - len(a(A, k)))
sol()


R = lambda : map(int, input().split())
(n, k) = R()
a = list(R())
print(sum((min(max(a[:i + 1]), max(a[i:])) <= k for i in range(n))))


(n, k) = input().strip().split(' ')
(n, k) = [int(n), int(k)]
c = list(map(int, input().strip().split(' ')))
l = 0
r = n - 1
ans = 0
while l <= r:
	if c[l] <= k and c[r] <= k and (l != r):
		l += 1
		r -= 1
		ans += 2
	elif c[l] <= k and c[r] <= k and (l == r):
		ans += 1
		l += 1
		r -= 1
	elif c[l] <= k:
		l += 1
		ans += 1
	elif c[r] <= k:
		r -= 1
		ans += 1
	elif c[l] > k and c[r] > k:
		break
print(ans)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
i = 0
j = n - 1
z = 0
l = True
r = True
while l or r:
	if i < n and a[i] <= k:
		i += 1
	else:
		l = False
	if j >= 0 and a[j] <= k:
		j -= 1
		z += 1
	else:
		r = False
if i == n or z == n:
	print(n)
else:
	print(i + z)


(n, k) = map(int, input().split())
a = [0] * n
a = input().split()
for i in range(n):
	a[i] = int(a[i])
ans = 0
i = n - 1
while a[i] <= k and i >= 0:
	ans += 1
	a[i] = -1
	i -= 1
i = 0
while a[i] <= k and i <= n - 1:
	if a[i] > 0:
		ans += 1
	i += 1
	if i == n:
		break
print(ans)


(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
l = 0
for i in range(n):
	if a[i] > k:
		break
	l += 1
r = 0
for i in range(n - 1, -1, -1):
	if a[i] > k or i <= l:
		break
	r += 1
print(l + r)


(n, k) = input().split()
n = int(n)
k = int(k)
list = input().split()
list = [int(i) for i in list]
max = 0
min = 0
for i in range(len(list)):
	if list[i] > k:
		max = i + 1
list.reverse()
for i in range(len(list)):
	if list[i] > k:
		min = i
		min = len(list) - i
if max == 0 & min == 0:
	print(len(list))
else:
	print(len(list) - max + min - 1)


arr = [int(x) for x in input().split()]
n = arr[0]
k = arr[1]
arr = [int(x) for x in input().split()]
count = 0
for i in range(n):
	if arr[i] <= k:
		count = count + 1
		arr[i] = k + 1
	else:
		break
for i in range(n):
	if arr[n - 1] <= k:
		count = count + 1
		arr[n - 1] = k + 1
		n = n - 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
(l, r) = (0, n - 1)
while l < n and a[l] <= k:
	l += 1
while r > l and a[r] <= k:
	r -= 1
print(n - r + l - 1)


(n, k) = map(int, input().split())
A = list(map(int, input().split()))
count = 0
d = 0
while len(A) > 0:
	if A[0] > k:
		c1 = True
	else:
		del A[0]
		c1 = False
		count += 1
	if len(A) > 0:
		if A[len(A) - 1] > k:
			c2 = True
		else:
			del A[len(A) - 1]
			c1 = False
			count += 1
	if c1 and c2:
		break
print(count)


(n, k) = map(int, input().split())
from collections import deque
a = deque(list(map(int, input().split())))
ans = 0
while True:
	if not a:
		break
	if a[0] <= k:
		ans += 1
		a.popleft()
	elif a[-1] <= k:
		ans += 1
		a.pop()
	else:
		break
print(ans)


(a, b) = map(int, input().split())
q = list(map(int, input().split()))
c = 0
for i in q:
	if b >= i:
		c += 1
	else:
		break
for j in range(len(q)):
	if b >= q[-1 - j]:
		c += 1
	else:
		break
if c >= a:
	print(a)
else:
	print(c)


(n, k) = list(map(int, input().split()))
ai = list(map(int, input().split()))
ans = 0
for i in range(n):
	if ai[i] > k:
		break
	ans += 1
for i in range(n - 1, -1, -1):
	if ai[i] > k:
		break
	ans += 1
print(min(n, ans))


(n, k) = map(int, input().split())
problems = list(map(int, input().split()))
numLeft = 0
numRight = 0
for i in range(n - 1, -1, -1):
	if problems[i] <= k:
		numLeft += 1
	else:
		break
for i in range(0, n):
	if problems[i] <= k:
		numRight += 1
	else:
		break
if numRight == n:
	print(n)
else:
	print(numRight + numLeft)


(n, k) = [int(c) for c in input().split(' ')]
a = [int(c) for c in input().split(' ')]
left = 0
right = len(a) - 1
totalcount = 0
while left <= right:
	if a[left] <= k:
		left += 1
		totalcount += 1
	elif a[right] <= k:
		right -= 1
		totalcount += 1
	else:
		break
print(totalcount)


temp = input().split()
n = int(temp[0])
k = int(temp[1])
a = input().split()
for i in range(n):
	a[i] = int(a[i])
big_end = 0
big_front = 0
count = 0
i = 0
while big_end + big_front != 2 and i < len(a):
	if a[i] <= k and big_front != 1:
		count = count + 1
	else:
		big_front = 1
	if a[n - i - 1] <= k and big_end != 1:
		count = count + 1
	else:
		big_end = 1
	i = i + 1
if count >= len(a):
	print(count // 2)
else:
	print(count)


first_row = input().split(' ')
tasks_number = int(first_row[0])
max_taks_level = int(first_row[1])
contest_tasks = input().split(' ')
number_of_solved_tasks = 0
has_unsolved_task = False
for current_task in contest_tasks:
	if int(current_task) <= max_taks_level:
		number_of_solved_tasks += 1
	else:
		has_unsolved_task = True
		break
if has_unsolved_task:
	for current_task_reverse in reversed(contest_tasks):
		if int(current_task_reverse) <= max_taks_level:
			number_of_solved_tasks += 1
		else:
			break
print(number_of_solved_tasks)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
while len(l) > 0:
	i = 0
	j = len(l) - 1
	if l[i] > k and l[j] > k:
		break
	elif l[i] <= k:
		c = c + 1
		l = l[i + 1:]
	elif l[j] <= k:
		c = c + 1
		l = l[:j]
print(c)


l = list(input().split())
n = int(l[0])
k = int(l[1])
l = list(input().split())
l = [int(i) for i in l]
problems = 0
for i in l:
	if i <= k:
		problems += 1
	else:
		break
for i in range(-1, -n - 1, -1):
	if l[i] <= k:
		problems += 1
	else:
		break
if problems > n:
	problems = problems // 2
print(problems)


def main():
	rd = lambda : list(map(int, input().split()))
	(n, k) = rd()
	arr = rd()
	i = 0
	j = len(arr) - 1
	cnt = 0
	flag1 = flag2 = True
	while i < j:
		if arr[i] <= k:
			cnt += 1
			i += 1
			flag1 = False
		if arr[j] <= k:
			cnt += 1
			j -= 1
			flag2 = False
		if flag1 and flag2:
			break
		flag1 = flag2 = True
	if i == j and arr[i] <= k:
		cnt += 1
	print(cnt)
main()


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

def count_while(data):
	if not data:
		return 0
	not_found = True
	for (i, v) in enumerate(data):
		if not v <= k:
			not_found = False
			break
	return i + not_found
data = list(map(int, input().split()))
n1 = count_while(data)
n2 = count_while(data[-1:n1:-1])
print(n1 + n2)


from sys import stdin

def solve(tc):
	(n, k) = map(int, stdin.readline().split())
	li = list(map(int, stdin.readline().split()))
	l = 0
	r = len(li) - 1
	cnt = 0
	while l <= r:
		if li[l] <= k:
			l += 1
			cnt += 1
		elif li[r] <= k:
			r -= 1
			cnt += 1
		else:
			break
	print(cnt)
LOCAL_TEST = not __debug__
if LOCAL_TEST:
	infile = __file__.split('.')[0] + '-test.in'
	stdin = open(infile, 'r')
tcs = int(stdin.readline().strip()) if LOCAL_TEST else 1
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


(n, k) = [int(n) for n in input().split()]
problems = [int(x) for x in input().split()]
ans = 0
for problem in problems:
	if problem <= k:
		ans += 1
	else:
		break
for problem in reversed(problems):
	if problem <= k:
		ans += 1
	else:
		break
if ans == 2 * n:
	ans = n
print(ans)


(n, k) = [int(s) for s in input().split(' ')]
a = [int(s) for s in input().split(' ')]
cnt = 0
while len(a) > 0 and a[0] <= k:
	cnt += 1
	del a[0]
a.reverse()
while len(a) > 0 and a[0] <= k:
	cnt += 1
	del a[0]
print(cnt)


z = input
mod = 10 ** 9 + 7
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0:
			return 0
	return 1
(n, m) = map(int, z().split())
l = list(map(int, z().split()))
t = 0
for i in range(n):
	x1 = l[-1]
	x2 = l[0]
	if x2 <= m:
		l = l[1:]
		t += 1
		continue
	if x1 <= m:
		l = l[:-1]
		t += 1
		continue
	else:
		break
print(min(t, n))


(n, k) = map(int, input().split())
c = 0
a = [int(x) for x in input().split()]
while a:
	i = 0
	if a[i] <= k:
		c += 1
		del a[i]
	elif a[len(a) - 1] <= k:
		c += 1
		del a[len(a) - 1]
	elif a[i] > k and a[len(a) - 1] > k:
		c += 0
		break
	i += 1
print(c)


(n, k) = map(int, input().split())
problems = list(map(int, input().split()))
lindex = 0
while lindex < n and problems[lindex] <= k:
	lindex += 1
rindex = n - 1
while rindex >= 0 and problems[rindex] <= k:
	rindex -= 1
if lindex == n or rindex == -1:
	print(n)
else:
	print(n - (rindex - lindex + 1))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(n):
	if a[i] <= k:
		count += 1
	else:
		break
if count == n:
	print(count)
	quit()
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		count += 1
	else:
		break
print(count)


(n, k) = [int(s) for s in input().split(' ')]
a = [int(s) for s in input().split(' ')]
c = 0
while len(a) > 0:
	if k < a[0] and k < a[len(a) - 1]:
		break
	if k >= a[0]:
		del a[0]
		c += 1
		continue
	if k >= a[len(a) - 1]:
		del a[len(a) - 1]
		c += 1
		continue
print(c)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
while min(a[-1], a[0]) <= k:
	c += 1
	if min(a[-1], a[0]) == a[-1]:
		a.pop(-1)
	else:
		a.pop(0)
	if len(a) == 0:
		break
print(c)


(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
isi = [0] * n
for i in range(n):
	if a[i] <= k:
		isi[i] = 1
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		isi[i] = 1
	else:
		break
kol = 0
for x in isi:
	kol += x
print(kol)


(n, k) = input().split()
n = int(n)
k = int(k)
flag = 0
count = 0
l = list(map(int, input().split()))
for i in range(0, len(l)):
	if l[i] <= k:
		count = count + 1
		flag = i + 1
	else:
		break
for i in range(0, len(l) - flag):
	if l[len(l) - 1 - i] <= k:
		count = count + 1
	else:
		break
print(count)


(n, k) = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
z = 0
z2 = 0
for i in l:
	if i <= k:
		z += 1
	else:
		break
for i in l[::-1]:
	if i <= k:
		z2 += 1
	else:
		break
if z == len(l):
	print(len(l))
else:
	print(z + z2)


(n, k) = map(int, input().split())
p = list(map(int, input().split()))
count = 0
while True:
	if len(p) != 0:
		if p[0] <= k:
			count += 1
			del p[0]
		elif p[len(p) - 1] <= k:
			count += 1
			del p[len(p) - 1]
		else:
			break
	else:
		break
print(count)


rd = lambda : list(map(int, input().split()))
(n, k) = rd()
a = rd()
(i, j) = (0, n - 1)
while i <= j and a[i] <= k:
	i += 1
while i < j and a[j] <= k:
	j -= 1
print(n - j + i - 1)


(n, k) = map(int, input().split())
line = list(map(int, input().split()))
trig = True
i = 0
while trig:
	if line[i] <= k and i != n - 1:
		i += 1
	elif i == n - 1 and line[i] <= k:
		ans = n
		trig = False
	else:
		ans = i
		trig = False
if ans == n:
	print(n)
else:
	trig = True
	i = n - 1
	while trig:
		if line[i] <= k:
			i -= 1
		else:
			ans += n - (i + 1)
			trig = False
	print(ans)


a = input()
tasks = input()
(n, k) = a.split(' ')
i = 0
if int(n) < 1:
	print(0)
list_of_tasks = tasks.split(' ')
while len(list_of_tasks) > 0:
	if int(list_of_tasks[0]) <= int(k):
		del list_of_tasks[0]
		i += 1
	elif int(list_of_tasks[-1]) <= int(k):
		del list_of_tasks[-1]
		i += 1
	else:
		break
print(i)


T_ON = 0
DEBUG_ON = 0
MOD = 998244353

def solve():
	(n, k) = read_ints()
	A = read_ints()
	count = 0
	i = 0
	while i < n and A[i] <= k:
		i += 1
	j = n - 1
	while j >= i and A[j] <= k:
		j -= 1
	print(i + n - 1 - j)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
for i in range(n):
	if l[0] >= l[-1]:
		if l[0] <= k:
			c += 1
			l.remove(l[0])
		elif l[-1] <= k:
			c += 1
			l.pop()
	elif l[-1] >= l[0]:
		if l[-1] <= k:
			c += 1
			l.pop()
		elif l[0] <= k:
			c += 1
			l.remove(l[0])
print(c)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
(q1, p) = (0, 0)
while q1 < len(a) and a[q1] <= k:
	p += 1
	q1 += 1
if q1 == len(a):
	print(n)
else:
	q2 = len(a) - 1
	while q2 > q1 and a[q2] <= k:
		p += 1
		q2 -= 1
	print(p)


import collections
d = collections.deque()
(n, k) = map(int, input().split(' '))
li = list(map(int, input().split()))
for i in range(len(li)):
	d.append(li[i])
count = 0
found = True
foundleft = True
while len(d) != 0:
	x = d.pop()
	if x <= k:
		count = count + 1
	else:
		d.append(x)
		break
while len(d) != 0:
	y = d.popleft()
	if y <= k:
		count = count + 1
	else:
		d.appendleft(y)
		break
print(count)


(n, k) = map(int, input().split())
lis = list(map(int, input().split()))
cnt = 0
for i in range(0, n):
	if lis[i] > k:
		break
	else:
		cnt += 1
for i in range(n - 1, -1, -1):
	if lis[i] > k:
		break
	else:
		cnt += 1
if cnt > n:
	cnt = n
print(cnt)


def ints():
	return [int(x) for x in input().split()]
(n, k) = ints()
xs = ints()
l = 0
for x in xs:
	if x > k:
		break
	l += 1
r = len(xs)
for x in reversed(xs):
	if x > k:
		break
	r -= 1
res = l
if l < r:
	res += len(xs) - r
print(res)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
s = set()
for i in range(n):
	if l[i] > k:
		break
	s.add(i)
for i in range(n):
	if l[n - i - 1] > k:
		break
	s.add(n - i - 1)
print(len(s))


(n, k) = map(int, input().split())
problems = list(map(int, input().split()))
(qtd, virou) = (0, False)
while True:
	if len(problems) == 0:
		print(qtd)
		break
	if problems.pop() > k:
		if virou == True:
			print(qtd)
			break
		else:
			virou = True
			problems.reverse()
	else:
		qtd += 1


(a, b) = map(int, input().split())
ar = list(map(int, input().split()))
rez = 0
if max(ar) > b:
	for i in ar:
		if i > b:
			break
		else:
			rez += 1
	for i in ar[::-1]:
		if i > b:
			break
		else:
			rez += 1
else:
	rez = a
print(rez)


(n, k) = map(int, input().split())
tasks = []
for i in input().split():
	tasks.append(int(i))
i = 0
s = 0
N = n
while True:
	if i >= n:
		break
	if tasks[i] <= k:
		s += 1
		i += 1
	elif tasks[N - 1] <= k:
		s += 1
		N -= 1
	else:
		break
print(s)


(n, k) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
ans = 0
i = 0
while i < n and a[i] <= k:
	ans += 1
	i += 1
j = n - 1
while j >= i and a[j] <= k:
	j -= 1
	ans += 1
print(ans)


(n, k) = list(map(int, input().split()))
l = list(map(int, input().split()))
if all([i <= k for i in l]):
	print(n)
else:
	(i, j) = (0, -1)
	c = 0
	while True:
		if l[i] <= k:
			i += 1
			c += 1
		elif l[j] <= k:
			j -= 1
			c += 1
		if l[i] > k and l[j] > k:
			break
	print(c)


(n, k) = map(int, input().split())
l = [*map(int, input().split())]
(left, right) = (0, n - 1)
while left <= right and l[left] <= k:
	left += 1
while left <= right and l[right] <= k:
	right -= 1
print(n - max(0, right - left + 1))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
while i < n:
	if a[i] > k:
		break
	i += 1
ans = i
j = n - 1
while j >= 0:
	if a[j] > k:
		break
	j -= 1
ans += n - 1 - j
if j == -1:
	print(n)
else:
	print(ans)


def read_numbers():
	return (int(s) for s in input().strip().split(' '))

def main():
	(n, k) = read_numbers()
	tasks = list(read_numbers())
	solved_tasks_count = 0
	lc = 0
	rc = len(tasks) - 1
	while solved_tasks_count < len(tasks):
		if tasks[lc] <= k:
			solved_tasks_count += 1
		else:
			break
		lc += 1
	while solved_tasks_count < len(tasks):
		if tasks[rc] <= k:
			solved_tasks_count += 1
		else:
			break
		rc -= 1
	print(solved_tasks_count)
main()


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
s = [i for (i, ai) in enumerate(a, 1) if ai > k]
t = n if len(s) == 0 else s[0] + n - s[-1] - 1
print(t)


import math
input0 = input()
input1 = input()
base = 0
temp = ''
for c in input0:
	if c == ' ':
		length = int(temp)
		temp = ''
	else:
		temp += c
level = int(temp)
listNumbers = []
tempC = ''
for c in input1:
	if c == ' ':
		listNumbers.append(int(tempC))
		tempC = ''
	else:
		tempC += c
listNumbers.append(int(tempC))
c = 0
left = True
flag = True
while flag and len(listNumbers) >= 1:
	if listNumbers[0] <= level:
		listNumbers.pop(0)
		c += 1
	elif listNumbers[-1] <= level:
		listNumbers.pop(-1)
		c += 1
	else:
		flag = False
		left = not left
print(c)


(n, k) = map(int, input().split())
a = [None] * n
completed = 0
a = input().split()
for i in range(0, n):
	a[i] = int(a[i])
front = 0
end = n - 1
while a[front] <= k and len(a) > 0:
	if a[front] <= k:
		del a[front]
		completed += 1
		end = len(a) - 1
	if len(a) <= 0:
		break
if len(a) > 0:
	while a[end] <= k and len(a) > 0:
		if a[end] <= k:
			del a[end]
			completed += 1
			end = len(a) - 1
		if len(a) <= 0:
			break
print(completed)


(x, y) = [int(a) for a in input().split()]
z = [int(a) for a in input().split()]
a = []
for i in z:
	if i <= y:
		a.append(i)
	else:
		break
if len(a) == x:
	print(x)
	quit()
z = z[::-1]
for i in z:
	if i <= y:
		a.append(i)
	else:
		break
print(len(a))


(n, k) = tuple(map(int, input().split(' ')))
probs = list(map(int, input().split(' ')))
canSolved = 0
l = 0
r = len(probs) - 1
while l <= r and probs[l] <= k:
	canSolved += 1
	l += 1
while l <= r and probs[r] <= k:
	canSolved += 1
	r -= 1
print(canSolved)


def f(a, n, k):
	c = 0
	for i in range(n):
		if a[i] <= k:
			c += 1
	return c == n
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
j = n - 1
c = 0
if f(a, n, k):
	print(n)
else:
	while a[i] <= k:
		c += 1
		i += 1
	if i != n - 1:
		while a[j] <= k:
			c += 1
			j -= 1
	print(c)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
while len(a) != 0 and a[0] <= k:
	a.pop(0)
while len(a) != 0 and a[-1] <= k:
	a.pop()
print(n - len(a))


(n, k) = [int(x) for x in input().split()]
line = list(map(int, input().split()))
h = 0
flag = True
while line != []:
	if line[0] > k:
		break
	h += 1
	del line[0]
line = line[::-1]
while line != []:
	if line[0] > k:
		break
	h += 1
	del line[0]
print(h)


(n, k) = input().split()
problems = input().split()
a = 0
b = 0
for i in range(int(n)):
	if int(problems[i]) > int(k):
		a = i
		break
for i in range(int(n) - 1, -1, -1):
	if int(problems[i]) > int(k):
		b = i
		b += 1
		break
if int(n) == 1:
	if int(problems[0]) <= int(k):
		print(1)
	else:
		print(0)
elif a == b:
	if b == 0:
		print(n)
	else:
		print(int(n) - 1)
else:
	print(int(n) - (b - a))


inp = input()
inp = inp.split(' ')
level = int(inp[1])
problem_set_string = input()
problem_set_string = problem_set_string.split(' ')
pset = []
for current_problem in problem_set_string:
	pset.append(int(current_problem))
num_problems = 0
for x in range(len(pset)):
	if len(pset) > 1:
		if pset[0] <= level:
			num_problems += 1
			pset.pop(0)
	if len(pset) > 1:
		if pset[-1] <= level:
			num_problems += 1
			pset.pop(-1)
if pset[0] <= level:
	num_problems += 1
print(num_problems)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
r = 0
z = 0
c = 0
for j in range(n):
	x = a[j]
	if x <= k:
		r = r + 1
	else:
		break
for o in range(n, 0, -1):
	if a[o - 1] <= k:
		z = z + 1
	else:
		break
s = r + z
if s > n:
	s = s // 2
	print(s)
else:
	print(s)


(a, b) = map(int, input().split())
li = list(map(int, input().split()))
(x, y) = (0, a - 1)
flag = 0
for i in range(len(li)):
	if li[x] <= b:
		x += 1
		flag += 1
	elif li[y] <= b:
		y -= 1
		flag += 1
	elif li[x] < b and li[y] < b:
		break
print(flag)


import sys
from collections import Counter

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
(N, K) = MAP()
A = LIST()
if max(A) <= K:
	print(N)
	exit()
ans = 0
for i in range(N):
	if A[i] > K:
		break
	else:
		ans += 1
for i in range(N - 1, -1, -1):
	if A[i] > K:
		break
	else:
		ans += 1
print(ans)


(n, k) = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
c = 0
flag = 0
while flag < 1:
	if len(l) == 0:
		break
	if l[0] <= k:
		l.pop(0)
		c = c + 1
	elif l[len(l) - 1] <= k:
		l.pop(len(l) - 1)
		c = c + 1
	elif l[0] > k and l[len(l) - 1] > k:
		flag = 1
	elif len(l) == 0:
		flag = 1
print(c)


s = input()
(n, k) = [int(x) for x in s.split()]
s = input()
a = [int(x) for x in s.split()]
ans = 0
while len(a) > 0 and a[0] <= k:
	del a[0]
while len(a) > 0 and a[len(a) - 1] <= k:
	del a[len(a) - 1]
print(n - len(a))


(n, m) = input().split()
(n, m) = (int(n), int(m))
lst = list()
lst = input().split()
ans = 0
try:
	while (m >= int(lst[0]) or m >= int(lst[len(lst) - 1])) and len(lst) > 0:
		if m >= int(lst[0]):
			lst.pop(0)
			ans += 1
		if m >= int(lst[len(lst) - 1]):
			lst.pop()
			ans += 1
except:
	pass
print(ans)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
m = max(l)
c1 = 0
c2 = 0
if m <= k:
	print(n)
	exit(0)
for x in l:
	if x > k:
		break
	c1 += 1
for i in range(n - 1, -1, -1):
	if l[i] > k:
		break
	c2 += 1
print(c1 + c2)


def solve(lst, pts):
	if len(lst) == 0:
		return 0
	elif pts >= lst[0]:
		return solve(lst[1:], pts) + 1
	elif pts >= lst[len(lst) - 1]:
		return solve(lst[:len(lst) - 1], pts) + 1
	else:
		return 0
(n, k) = [int(t) for t in input().split()]
x = [int(t) for t in input().split()]
print(solve(x, k))


nk = [int(x) for x in input().split()]
n = nk[0]
k = nk[1]
arr = [int(x) for x in input().split()]
i = 0
while i < n and arr[i] <= k:
	i += 1
flag = False
if i == n:
	flag = True
	print(n)
j = 1
while j < n + 1 and arr[-1 * j] <= k:
	j += 1
if not flag:
	print(i + j - 1)


(n, m) = map(int, input().split())
x = list(map(int, input().split()))
count = 0
flag = True
for i in x:
	if i <= m:
		count = count + 1
	else:
		flag = False
		break
if flag == False:
	for i in x[::-1]:
		if i <= m:
			count = count + 1
		else:
			break
print(count)


(n, k) = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
l = 0
r = n - 1
ans = 0
ct = [0] * n
for l in range(n):
	if A[l] > k:
		break
	ct[l] = 1
for r in range(n - 1, -1, -1):
	if A[r] > k:
		break
	ct[r] = 1
print(sum(ct))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
a_reversed = list(reversed(a))
i = 0
j = 0
left_problems_n = 0
right_problems_n = 0
while i < n:
	if a[i] <= k:
		left_problems_n += 1
		i += 1
	else:
		break
while j < n and left_problems_n + right_problems_n != n:
	if a_reversed[j] <= k:
		right_problems_n += 1
		j += 1
	else:
		break
print(left_problems_n + right_problems_n)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
for x in range(n):
	if a[x] <= k:
		c += 1
	else:
		break
for x in reversed(range(n)):
	if a[x] <= k:
		c += 1
	else:
		break
if c >= n:
	print(n)
else:
	print(c)


rd = lambda : list(map(int, input().split()))
(n, k) = rd()
a = rd()
L = 0
r = n - 1
ans = 0
while L < n - 1:
	if a[L] > k:
		break
	L += 1
	ans += 1
while r >= 0 and r >= L:
	if a[r] > k:
		break
	ans += 1
	r -= 1
print(ans)


import sys

def mp():
	return list(map(int, input().split()))
if 0:
	f = open('input.txt', 'r')
	input = f.readline

def _main():
	(n, k) = mp()
	a = mp()
	ans = 0
	T = False
	for i in range(n):
		if a[i] <= k:
			ans += 1
		else:
			T = 1
			break
	for i in range(n - 1, -1, -1):
		if a[i] <= k:
			ans += 1
		else:
			break
	if T:
		print(ans)
	else:
		print(n)
_main()


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
l = 0
ans = 0
inds = []
for i in range(n):
	if a[i] <= k:
		l = i
		inds.append(i)
		ans += 1
	else:
		break
r = n - 1
for i in reversed(range(n)):
	if i not in inds and a[i] <= k:
		r = i
		ans += 1
	else:
		break
print(ans)


a = input().split()
limit = int(a[1])
skills = list(map(int, input().split()))
length = len(skills)
i = 0
while skills[0] <= limit and len(skills) > 1:
	skills.remove(skills[0])
	i = i + 1
skills.reverse()
while skills[0] <= limit and len(skills) > 1:
	skills.remove(skills[0])
	i = i + 1
if skills[0] <= limit:
	i = i + 1
print(i)


import sys
(n, k) = map(int, sys.stdin.readline().split())
an = list(map(int, sys.stdin.readline().split()))
ans = 0
i = 0
while i < n and an[i] <= k:
	i += 1
	ans += 1
j = n - 1
while j >= i and an[j] <= k:
	j -= 1
	ans += 1
print(ans)


(n, k) = map(int, input().split())
arr = [int(x) for x in input().split()]
mins = []
for i in range(len(arr)):
	if arr[i] > k:
		mins.append(i)
if not mins:
	print(n)
else:
	print(mins[0] - 1 + (n - mins[-1]))


(n, k) = map(int, input().strip().split())
problem = list(map(int, input().strip().split()))
count = 0
i = 0
while i < len(problem) and problem[i] <= k:
	count += 1
	del problem[i]
problem = list(reversed(problem))
i = 0
while i < len(problem) and problem[i] <= k:
	count += 1
	del problem[i]
print(count)


def int_lst_input():
	return [int(val) for val in input().split(' ')]

def int_input():
	return int(input())

def print_lst(lst):
	print(' '.join([str(val) for val in lst]))

def solve():
	(n, k) = int_lst_input()
	a = int_lst_input()
	(i, j) = (0, n - 1)
	c = 0
	while i <= j and (a[i] <= k or a[j] <= k):
		if a[i] <= k:
			c += 1
			i += 1
		elif a[j] <= k:
			c += 1
			j -= 1
	print(c)
solve()


x = list(map(int, input().split()))
y = list(map(int, input().split()))
t = 0
for i in range(len(y)):
	if y[i] <= x[1]:
		t = t + 1
	else:
		break
for j in range(-1, -(len(y) - i), -1):
	if y[j] <= x[1]:
		t = t + 1
	else:
		break
print(t)


R = lambda : map(int, input().split())
(n, k) = R()
a = list(R())
f = lambda l: next((i for (i, x) in enumerate(l) if x > k))
try:
	r = f(a) + f(a[::-1])
except:
	r = len(a)
print(r)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
cnt = 0
ind = 0
for i in range(len(l)):
	if l[i] > k:
		break
	cnt += 1
	ind = i
for i in range(n - 1, ind, -1):
	if l[i] > k:
		break
	else:
		cnt += 1
print(cnt)


(n, k) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
answer = 0
while len(a) > 0:
	if a[0] <= k:
		a.pop(0)
		answer += 1
	elif a[-1] <= k:
		a.pop(len(a) - 1)
		answer += 1
	else:
		print(answer)
		quit()
print(n)


(n, k) = [int(__) for __ in input().strip().split()]
arr = [int(__) for __ in input().strip().split()]
ans = 0
while True and len(arr) > 0:
	if arr[0] <= k:
		ans += 1
		arr = arr[1:]
	else:
		break
arr = arr[::-1]
while True and len(arr) > 0:
	if arr[0] <= k:
		ans += 1
		arr = arr[1:]
	else:
		break
print(ans)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
while a != []:
	if a[0] <= k:
		c += 1
		del a[0]
	elif a[-1] <= k:
		c += 1
		del a[-1]
	else:
		break
print(c)


l = [int(x) for x in input().split()]
n = l[0]
k = l[1]
l = [int(x) for x in input().split()]
count = 0
for i in range(len(l)):
	n = len(l)
	if l[0] > k and l[n - 1] > k:
		break
	elif l[0] <= k:
		del l[0]
		count += 1
	elif l[n - 1] <= k:
		del l[n - 1]
		count += 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
while len(a) != 0 and (a[0] <= k or a[-1] <= k):
	if a[0] <= k and len(a) != 0:
		count += 1
		a.pop(0)
	elif a[-1] <= k and len(a) != 0:
		count += 1
		a.pop(-1)
print(count)


number_of_testcases = 1
for _ in range(number_of_testcases):
	(number_of_problems, solving_skill) = map(int, input().split())
	difficulty_level = list(map(int, input().split()))
	max_prob_sol = 0
	while difficulty_level != []:
		if difficulty_level[0] <= solving_skill:
			max_prob_sol += 1
			difficulty_level.pop(0)
		elif difficulty_level[-1] <= solving_skill:
			max_prob_sol += 1
			difficulty_level.pop(-1)
		else:
			break
	print(max_prob_sol)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz/'
M = 1000000007
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
(n, k) = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
while len(a) > 0:
	chk = 0
	if len(a) > 0 and a[0] <= k:
		a.pop(0)
		chk = 1
	if len(a) > 0 and a[len(a) - 1] <= k:
		a.pop()
		chk = 1
	if chk == 0:
		break
print(n - len(a))


nskill = input().split(' ')
n = int(nskill[0])
skill = int(nskill[1])
prob = input().split(' ')
solved = 0
for i in range(n):
	if skill >= int(prob[0]):
		del prob[0]
		solved += 1
	elif skill >= int(prob[-1]):
		del prob[-1]
		solved += 1
print(solved)


s = input()
(n, k) = s.split()
a = input()
left = a.split()
right = left[::-1]
timel = ''
timer = ''
for x in range(int(n)):
	if int(left[x]) > int(k):
		if timel == '':
			timel = x
		elif timer != '' and timel != '':
			break
		else:
			pass
	if int(right[x]) > int(k):
		if timer == '':
			timer = x
		elif timer != '' and timel != '':
			break
		else:
			pass
if timel == '' and timer == '':
	print(int(n))
else:
	print(timel + timer)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for el in a:
	if el > k:
		break
	ans += 1
if ans == n:
	print(n)
	exit()
for el in a[::-1]:
	if el > k:
		break
	ans += 1
print(ans)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
ans1 = 0
for i in range(n):
	if l[i] <= k:
		ans += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if l[i] <= k:
		ans1 += 1
	else:
		break
if ans == n and ans1 == n:
	print(n)
else:
	print(ans + ans1)


t = input().strip().split(' ')
n = int(t[0])
cap = int(t[1])
t = input().strip().split(' ')
t = [int(e) for e in t]
assert len(t) == n
count = 0
while True:
	if len(t) == 0:
		break
	if t.pop() <= cap:
		count += 1
	else:
		break
t = list(reversed(t))
while True:
	if len(t) == 0:
		break
	if t.pop() <= cap:
		count += 1
	else:
		break
print(count)


from collections import deque
(n, k) = map(int, input().split())
tasks = list(map(int, input().split()))
d = deque()
for c in tasks:
	d.append(c)
answer = 0
while True:
	if len(d) == 0:
		break
	l = d.popleft()
	if l > k:
		d.appendleft(l)
		break
	else:
		answer += 1
while True:
	if len(d) == 0:
		break
	l = d.pop()
	if l > k:
		d.append(l)
		break
	else:
		answer += 1
print(answer)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(n, k) = invr()
ara = inara()
ans = set()
l = 0
while l < n:
	if ara[l] <= k:
		ans.add(l)
		l += 1
	else:
		break
r = n - 1
while r >= 0:
	if ara[r] <= k:
		ans.add(r)
		r -= 1
	else:
		break
print(len(ans))


(size, capacity) = map(int, input().split())
arr = list(map(int, input().split()))
cou = 0
for i in arr:
	if i <= capacity:
		cou += 1
	else:
		break
if cou != len(arr):
	for i in range(len(arr) - 1, -1, -1):
		if arr[i] <= capacity:
			cou += 1
		else:
			break
print(cou)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
lc = 0
rc = 0
i = 0
m = 0
while k >= a.pop(0):
	lc += 1
	if len(a) == 0:
		m = 1
		break
if m == 1 or len(a) == 0:
	print(lc)
else:
	while k >= a.pop():
		rc += 1
		if len(a) == 0:
			break
	print(rc + lc)


(a, b) = list(map(int, input().split()))
t = list(map(int, input().split()))
s = 0
for i in range(a):
	if t[0] <= b:
		del t[0]
		s += 1
	elif t[len(t) - 1] <= b:
		del t[len(t) - 1]
		s += 1
	else:
		print(s)
		break
if len(t) == 0:
	print(s)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
solved = 0
i = 0
while i < n and a[i] <= k:
	solved += 1
	i += 1
end = i
i = n - 1
while a[i] <= k and i > end:
	solved += 1
	i -= 1
print(solved)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
b = a[::-1]
solved = [0] * n
(lc, rc) = (0, 0)
for i in range(n):
	if a[i] <= k:
		solved[i] = 1
	else:
		break
for i in range(n):
	if b[i] <= k:
		solved[n - 1 - i] = 1
	else:
		break
print(solved.count(1))


c = input()
l1 = c.split()
n = int(l1[0])
k = int(l1[1])
l2 = input()
l3 = l2.split()
l = []
for i in l3:
	l.append(int(i))
nb = 0
while l != []:
	if l[0] <= k:
		nb = nb + 1
		l.pop(0)
	elif l[len(l) - 1] <= k:
		nb = nb + 1
		l.pop(len(l) - 1)
	else:
		break
print(nb)


def func():
	constraints = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	count = 0
	while len(arr) > 0:
		if arr[0] <= constraints[1]:
			arr.pop(0)
			count += 1
		elif arr[len(arr) - 1] <= constraints[1]:
			arr.pop(len(arr) - 1)
			count += 1
		else:
			break
	print(count)
func()


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
count = 0
while arr[0] <= k:
	count += 1
	arr.pop(0)
	if len(arr) == 0:
		break
if len(arr) != 0:
	while arr[len(arr) - 1] <= k:
		arr.pop(len(arr) - 1)
		count += 1
print(count)


r = input().split()
n = int(r[0])
k = int(r[1])
left = 0
right = 0
cout = 0
n -= 1
mas = input().split()
while int(mas[left]) <= k and left < n:
	left += 1
	cout += 1
	if left == n:
		break
left -= 1
while int(mas[n - right]) <= k and n - right > left:
	right += 1
	cout += 1
print(cout)


INF = 1 << 60
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
while True:
	if len(a) == 0:
		break
	if a[0] <= k:
		a = a[1:]
		ans += 1
	elif a[-1] <= k:
		a = a[:-1]
		ans += 1
	else:
		break
print(ans)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
c = 0
d = 0
for x in range(len(a)):
	if a[x] <= k:
		c += 1
	else:
		break
for x in range(len(a) - 1, 0, -1):
	if a[x] <= k:
		d += 1
	else:
		break
if c == n:
	print(c)
elif d == n:
	print(d)
else:
	print(d + c)


from collections import deque
(n, k) = map(int, input().split())
a = deque(map(int, input().split()))
while a and (a[0] <= k or a[-1] <= k):
	if a[0] <= k:
		a.popleft()
	else:
		a.pop()
print(n - len(a))


(n, m) = map(int, input().split())
lst = [int(x) for x in input().split()]
l = 0
r = n - 1
while l < n:
	if lst[l] > m:
		break
	l += 1
while r > l:
	if lst[r] > m:
		break
	r -= 1
print(n - (r - l) - 1)


(n, k) = map(int, input().split())
L = list(map(int, input().split()))
(i, j) = (0, n - 1)
c = 0
while i < n:
	if L[i] <= k:
		c += 1
	else:
		break
	i = i + 1
while j >= 0 and j > i - 1:
	if L[j] <= k:
		c += 1
	else:
		break
	j = j - 1
print(c)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
while i < n:
	if a[i] > m:
		break
	else:
		i = i + 1
j = n - 1
while j >= i:
	if a[j] > m:
		break
	else:
		j = j - 1
print(n - (j - i + 1))


(n, k) = map(int, input().split())
A = list(map(int, input().split()))
from collections import deque
q = deque(A)
for i in range(len(q)):
	if q[0] <= k:
		q.popleft()
	else:
		break
for i in range(len(q)):
	if q[-1] <= k:
		q.pop()
	else:
		break
print(n - len(q))


a = input().split()
n = int(a[0])
k = int(a[1])
b = list(map(int, input().split()))
x = 0
y = n - 1
count = 0
while x <= y:
	if b[x] <= k:
		x += 1
		count += 1
	elif b[y] <= k:
		y -= 1
		count += 1
	else:
		break
print(count)


(n, k) = input().split()
n = int(n)
k = int(k)
d = input().split()
for i in range(len(d)):
	d[i] = int(d[i])
ci = 0
cj = 0
for i in range(n):
	if d[i] > k:
		break
	ci += 1
for j in range(-1, -n - 1, -1):
	if d[j] > k:
		break
	cj += 1
if ci + cj > n:
	print(n)
else:
	print(ci + cj)


(n, k) = map(int, input().split())
A = map(int, input().split())
A = ''.join(('1' if a <= k else '0' for a in A))
print(n - len(A.strip('1')))


nums = [int(i) for i in input().split()]
arr = [int(i) for i in input().split()]
k = nums[1]
left = 0
right = 0
for i in range(len(arr)):
	if arr[i] > k:
		left = i + 1
		break
for i in range(len(arr) - 1, -1, -1):
	if arr[i] > k:
		right = i + 1
		break
if left == 0 and right == 0 and (len(arr) != 1):
	res = len(arr)
elif len(arr) == 1:
	if arr[0] <= k:
		res = 1
	else:
		res = 0
else:
	res = len(arr) - (right - left + 1)
print(res)


(n, k) = map(int, input().split())
ls = list(map(int, input().split()))
front = back = -1
for i in range(n):
	if ls[i] > k and front == -1:
		front = i
	if ls[n - i - 1] > k and back == -1:
		back = n - i - 1
if front == -1:
	print(n)
else:
	print(n - back + front - 1)


(n, k) = map(int, input().strip().split())
diff = list(map(int, input().strip().split()))
l = 0
r = n - 1
count = 0
while l < n and diff[l] <= k:
	l += 1
while r >= 0 and diff[r] <= k:
	r -= 1
if r == n - 1:
	r + 1
if l == n and r == -1:
	print(n)
else:
	print(l + (n - r - 1))


m = list(map(int, input().split()))
n = list(map(int, input().split()))
max = 0
counter = 0
i = 0
j = m[0] - 1
while True:
	if n[i] <= m[1] or n[j] <= m[1]:
		if n[i] >= n[j]:
			j -= 1
		else:
			i += 1
		counter += 1
	else:
		break
	if i > j:
		break
print(counter)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
while i < n:
	if a[i] > k:
		break
	i += 1
ans = i
i = n - 1
while i > -1:
	if a[i] > k:
		break
	i -= 1
ans += n - 1 - i
print(min(ans, n))


(n, k) = map(int, input().split())
ara = list(map(int, input().split()))
ans = 0
while len(ara) > 0 and ara[0] <= k:
	ara.pop(0)
	ans += 1
while len(ara) > 0 and ara[-1] <= k:
	ara.pop(-1)
	ans += 1
print(ans)


(hm, k) = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
(l, r) = (0, len(a) - 1)
while l <= r and a[l] <= k:
	l += 1
	cnt += 1
while l <= r and a[r] <= k:
	r -= 1
	cnt += 1
print(cnt)


(n, k) = map(int, input().split())
lst = list(map(int, input().split()))
cnt = 0
while n and lst[0] <= k:
	lst.pop(0)
	n -= 1
	cnt += 1
while n and lst[n - 1] <= k:
	lst.pop(n - 1)
	n -= 1
	cnt += 1
print(cnt)


(n, k) = list(map(int, input().split()))
problems = list(map(int, input().split()))
i = 0
m = 0
for digit in problems:
	if digit <= k:
		i += 1
	else:
		m = 1
		break
for digit in problems[::-1]:
	if digit <= k:
		i += 1
	else:
		m = 1
		break
if m == 0:
	print(int(i / 2))
else:
	print(i)


(n, k) = map(int, input().split())
A = list(map(int, input().split()))
i = 0
j = 0
l = 0
while l < n:
	if A[i] <= k:
		A.remove(A[i])
		l += 1
	else:
		l += 1
		break
A.reverse()
m = 0
o = len(A)
while m < o:
	if A[j] <= k:
		A.remove(A[j])
		m += 1
	else:
		m += 1
		break
f = len(A)
print(n - f)


(a, b) = [int(s) for s in input().split()]
test = [int(s) for s in input().split()]
(count, count1) = (0, 0)
for i in test:
	if i > b:
		break
	count += 1
for j in test[::-1]:
	if j > b:
		break
	count1 += 1
if count + count1 > a:
	print(a)
else:
	print(count + count1)


(n, k) = [int(s) for s in input().split(' ')]
list = [int(s) for s in input().split(' ')]
for i in range(0, n):
	if k >= list[0]:
		list.pop(0)
	else:
		break
for i in range(0, n):
	if len(list) > 0 and k >= list[len(list) - 1]:
		list.pop(len(list) - 1)
	else:
		break
print(n - len(list))


(n, k) = map(int, input().split())
listik = list(map(int, input().split()))
(counter, j) = (0, 1)
for i in range(2):
	for i in listik:
		if i <= k:
			counter += 1
		else:
			break
	if j == 1:
		listik = listik[counter:][::-1]
print(counter)


(N, K) = map(int, input().split())
A = list(map(int, input().split()))
Ans = 0
for i in range(N):
	if A[i] <= K:
		Ans += 1
	else:
		break
for i in range(N):
	if A[N - 1 - i] <= K:
		Ans += 1
	else:
		break
print(min(N, Ans))


(n, k) = list(map(int, input().split()))
x = list(map(int, input().split()))
count = 0
while len(x) != 0 and (x[0] <= k or x[-1] <= k):
	if x[0] <= k:
		count += 1
		del x[0]
	elif x[-1] <= k:
		count += 1
		del x[-1]
print(count)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
d = 0
e = 0
j = len(l)
while len(l) != 0:
	if e % 2 == 0:
		if l[0] <= k:
			l.pop(0)
		else:
			c = 1
	if e % 2 != 0:
		if l[-1] <= k:
			l.pop()
		else:
			d = 1
	if c == 1 and d == 1:
		break
	e = e + 1
print(j - len(l))


(n, skill) = map(int, input().split())
tasks = list(map(int, input().split()))
l = r = 0
for i in range(n):
	if tasks[i] > skill:
		l = i
		break
else:
	l = n
for j in range(n - 1, -1, -1):
	if tasks[j] > skill:
		r = j
		break
else:
	r = -1
print(n if l > r else n - (r - l + 1))


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
s = 0
while True:
	if len(l) > 0:
		if l[0] <= m:
			s += 1
			del l[0]
		elif l[-1] <= m:
			s += 1
			del l[-1]
		else:
			print(s)
			exit()
	else:
		print(s)
		exit()


(n, k) = map(int, input().split())
ai = list(map(int, input().split()))
cnt = 0
res = None
for i in range(n):
	if ai[i] > k:
		res = i
		break
	else:
		cnt += 1
if res != None:
	rev_ai = ai[res:][::-1]
	for i in rev_ai:
		if i > k:
			break
		else:
			cnt += 1
print(cnt)


import sys
input = sys.stdin.readline
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
c = 0

def f(a):
	for i in range(len(a)):
		if a[i] > k:
			return i
	return len(a)

def g(a):
	for j in range(n - 1, -1, -1):
		if a[j] > k:
			return j
	return len(a)
w = a[:f(a)]
e = a[g(a):-1]
if len(w) == len(a):
	print(len(w))
else:
	print(len(w) + len(e))


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
count = 0
while len(a) > 0:
	if a[-1] <= k:
		a.reverse()
	b = a.pop(0)
	if b > k:
		break
	count += 1
print(count)


(totalProblems, skill) = list(map(int, input().split(' ')))
problems = list(map(int, input().split(' ')))
lowerBound = totalProblems - 1
for i in range(totalProblems):
	if problems[i] > skill:
		lowerBound = i - 1
		break
for i in range(totalProblems):
	if totalProblems - 1 - i == lowerBound:
		print(totalProblems)
		break
	elif problems[totalProblems - 1 - i] > skill:
		print(lowerBound + 1 + i)
		break


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
while a and (a[0] <= k or a[-1] <= k):
	if a[0] <= k:
		a = a[1:]
		c += 1
	if not a:
		break
	if a[-1] <= k:
		a = a[:-1]
		c += 1
print(c)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
if max(a) <= k:
	print(n)
else:
	i = 0
	j = n - 1
	while a[i] <= k:
		i += 1
	while a[j] <= k:
		j -= 1
	print(n - (j - i + 1))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
i = 0
z = True
while i < n and z:
	if a[i] <= k:
		s = s + 1
		i = i + 1
	else:
		z = False
if s == n:
	print(s)
else:
	i = n - 1
	z = True
	while z and i > 0:
		if a[i] <= k:
			s = s + 1
			i = i - 1
		else:
			z = False
	print(s)


(a, b) = [int(z) for z in input().split(' ')]
c = input().split(' ')
t = True
x = 0
y = 0
for i in range(a):
	if b >= int(c[i]) and t:
		x += 1
	else:
		t = False
	if not t:
		if b >= int(c[i]):
			y += 1
		else:
			y = 0
print(x + y)


import math
import string
s = str(input()).split()
n = int(s[0])
k = int(s[1])
a = []
s.clear()
s = str(input()).split()
tot = 0
for i in range(0, n):
	a.append(int(s[i]))
for i in range(0, n):
	if a[i] <= k:
		tot += 1
	else:
		break
for i in range(0, n):
	if a[n - i - 1] <= k:
		tot += 1
	else:
		break
if tot > n:
	tot = n
print(tot)


ip = [int(x) for x in input().split()]
n = ip[0]
k = ip[1]
problist = [int(x) for x in input().split()]
solved = 0
iterator = 0
start = 0
end = n - 1
lf = 0
rf = 0
for i in range(n):
	if problist[start] <= k:
		start += 1
		lf += 1
	else:
		break
for i in range(n):
	if problist[end] <= k:
		end -= 1
		rf += 1
	else:
		break
print(min(n, lf + rf))


(N, K) = map(int, input().split())
S = list(map(int, input().split()))
count = 0
for i in range(N):
	if S[i] <= K:
		count += 1
	else:
		break
S.reverse()
n = count
for i in range(0, N - n):
	if S[i] <= K:
		count += 1
	else:
		break
print(count)


from collections import *
(n, r) = map(int, input().split())
dq = deque([int(x) for x in input().split()])
while 1:
	if len(dq) == 0:
		break
	if dq[0] <= r:
		dq.popleft()
	elif dq[-1] <= r:
		dq.pop()
	else:
		break
print(n - len(dq))


(n, k) = list(map(int, input().split()))
prob = list(map(int, input().split()))
Max = 0
i = 0
while i < len(prob):
	if prob[i] <= k:
		i += 1
		Max += 1
	else:
		break
if i < len(prob):
	i = 1
	while i < len(prob):
		if prob[-i] <= k:
			i += 1
			Max += 1
		else:
			break
print(Max)


(n, k) = [int(i) for i in input().split()]
a = [int(j) for j in input().split()]
g = 0
while a[0] <= k or a[len(a) - 1] <= k:
	if a[0] <= k:
		a.pop(0)
	elif a[len(a) - 1] <= k:
		a.pop()
	g += 1
	if len(a) == 0:
		break
print(g)


from collections import deque
(n, k) = map(int, input().split())
a = deque(list(map(int, input().split())))
while len(a) > 0 and a[0] <= k:
	a.popleft()
while len(a) > 0 and a[-1] <= k:
	a.pop()
print(n - len(a))


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
a = 0
b = 0
for i in range(n):
	if k < arr[i]:
		break
	else:
		a += 1
for i in range(n):
	if k < arr[n - i - 1]:
		break
	else:
		b += 1
if a == b and b == n:
	print(n)
else:
	print(a + b)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
k1 = 0
k2 = 0
for i in range(n):
	if a[i] <= k:
		k1 += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		k2 += 1
	else:
		break
print(min(k1 + k2, n))


(n, k) = map(int, input().split())
u = list(map(int, input().split()))
ans = 0
while 1 == 1:
	ok = 0
	if u[0] <= k:
		ans += 1
		ok = 1
		u.pop(0)
	if len(u) > 0 and u[-1] <= k:
		ans += 1
		u.pop()
		ok = 1
	if not ok or len(u) == 0:
		print(ans)
		break


def main():
	(n, k) = map(int, input().split())
	x = list(map(int, input().split()))
	result = 0
	for i in range(n):
		if x[i] <= k:
			result += 1
			x[i] += k
		else:
			break
	for i in reversed(x):
		if i <= k:
			result += 1
		else:
			break
	print(result)
main()


(n, k) = input().split()
n = int(n)
k = int(k)
count = 0
a = list(map(int, input().split(' ')))
for i in range(n - 1, -1, -1):
	if a[0] > a[i]:
		if a[i] <= k:
			a.pop()
			count += 1
		else:
			break
	elif a[0] <= k:
		a.remove(a[0])
		count += 1
	else:
		break
print(count)


(n, x) = map(int, input().split())
A = list(map(int, input().split()))
i = 0
j = n - 1
count = 0
while i <= j:
	if A[i] <= x:
		count += 1
		i += 1
	elif A[j] <= x:
		count += 1
		j -= 1
	else:
		break
print(count)


(n, k) = [int(i) for i in input().split(' ')]
dificulties = [int(i) for i in input().split(' ')]
solve = 0
for i in dificulties:
	if i > k:
		break
	else:
		solve += 1
for i in dificulties[::-1]:
	if i > k:
		break
	else:
		solve += 1
if solve == 2 * n:
	print(n)
else:
	print(solve)


(n, k) = map(int, input().split())
tasks = list(map(int, input().split()))
(l, r) = (0, len(tasks) - 1)
res = 0
while l <= r:
	if tasks[l] <= k:
		res += 1
		l += 1
	elif tasks[r] <= k:
		res += 1
		r -= 1
	else:
		break
print(res)


(n, k) = map(int, input().split())
A = [*map(int, input().split())]
(l, r) = (0, 0)
for i in range(n):
	if A[i] <= k:
		l += 1
	else:
		break
for j in range(n - 1, l, -1):
	if A[j] <= k:
		r += 1
	else:
		break
print(l + r)


ans = 0
(a, b) = map(int, input().split())
l = list(map(int, input().split()))
for x in range(len(l)):
	if l[x] <= b:
		ans += 1
	else:
		for x in range(len(l) - 1, 0, -1):
			if l[x] <= b:
				ans += 1
			else:
				break
		break
print(ans)


import sys
import collections
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))
(n, k) = inpl()
q = collections.deque(inpl())
while q:
	now = q.popleft()
	if now > k:
		q.appendleft(now)
		break
while q:
	now = q.pop()
	if now > k:
		q.append(now)
		break
print(n - len(q))


(n, k) = map(int, input().split())
ans = 0
ans1 = 0
a = list(map(int, input().split()))
for t in range(n):
	if a[t] > k:
		break
	ans = t + 1
a.reverse()
for t in range(n):
	if a[t] > k:
		break
	ans1 = t + 1
print(min(ans1 + ans, n))


(n, k) = map(int, input().split())
s = [int(i) for i in input().split()]
c = 0
for i in range(n):
	if s[i] <= k:
		s[i] = k + 1
		c += 1
	else:
		break
for i in range(n):
	if s[-i - 1] <= k:
		c += 1
	else:
		break
print(c)


(n, k) = map(int, input().split())
l = [int(i) for i in input().split()]
a = 0
while len(l) > 0:
	if l[0] <= k or l[-1] <= k:
		if l[0] <= k:
			l.remove(l[0])
		else:
			l.pop()
		a += 1
	else:
		break
print(a)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
while True:
	if len(l) == 0:
		break
	if l[0] <= k:
		l.remove(l[0])
	elif l[len(l) - 1] <= k:
		del l[len(l) - 1]
	else:
		break
print(n - len(l))


k = input().split()
n = int(k[0])
k = int(k[1])
s = 0
a = input().split()
for i in range(n):
	if int(a[i]) > k:
		break
	while int(a[i]) <= k:
		s += 1
		a[i] = k + 1
for i in range(n - 1, 0, -1):
	if int(a[i]) > k:
		break
	while int(a[i]) <= k:
		s += 1
		a[i] = k + 1
print(s)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
head = 0
tail = len(a) - 1
ans = 0
while True:
	if head == tail and a[head] <= k:
		ans += 1
		break
	if head > tail:
		break
	if max(a[head], a[tail]) <= k:
		ans += 2
		head += 1
		tail -= 1
		continue
	if a[head] <= k < a[tail]:
		ans += 1
		head += 1
		continue
	if a[tail] <= k < a[head]:
		ans += 1
		tail -= 1
		continue
	if k < min(a[head], a[tail]):
		break
print(ans)


c = 0
(n, k) = map(int, input().split())
a = [int(i) for i in input().split()]
for i in range(n):
	if a[0] <= k:
		c += 1
		del a[0]
	elif a[len(a) - 1] <= k:
		c += 1
		del a[len(a) - 1]
	else:
		break
print(c)


i = input
(n, k) = map(int, i().split())
l = [*map(int, i().split())]
c = 0
ind1 = 0
ind2 = n - 1
while ind1 != n and l[ind1] <= k:
	c += 1
	ind1 += 1
while ind2 > ind1 and l[ind2] <= k:
	c += 1
	ind2 -= 1
print(c)


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
d = [0] * a
n = 0
for i in range(a):
	if c[i] <= b and d[i] == 0:
		n += 1
		d[i] = 1
	else:
		break
for i in range(a - 1, -1, -1):
	if c[i] <= b and d[i] == 0:
		n += 1
		d[i] = 1
	else:
		break
print(n)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
l = 0
r = n - 1
c = 0
if max(a) <= k:
	print(n)
else:
	while l <= n - 1:
		if a[l] <= k:
			c += 1
			l += 1
		elif a[l] > k:
			break
	while r >= 0:
		if a[r] <= k:
			c += 1
			r -= 1
		else:
			break
	print(c)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
cou = 0
while len(a) >= 1 and a[-1] <= k:
	del a[-1]
	cou += 1
a = a[::-1]
while len(a) >= 1 and a[-1] <= k:
	del a[-1]
	cou += 1
print(cou)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
while len(a) > 0 and (a[0] <= k or a[-1] <= k):
	if a[0] <= k:
		s += 1
		del a[0]
	if len(a) > 0:
		if a[-1] <= k:
			s += 1
			del a[-1]
print(s)


inp = input().split(' ')
n = int(inp[0])
k = int(inp[1])
inp = input().split(' ')
count = 0
for num in inp:
	if int(num) <= k:
		count += 1
	else:
		break
for idx in range(n - 1, count, -1):
	if int(inp[idx]) <= k:
		count += 1
	else:
		break
print(count)


entrada = input().split(' ')
arr = input().split(' ')
n = int(entrada[0])
k = int(entrada[1])
count_l = 0
count_r = 0
for i in range(n):
	if int(arr[i]) <= k:
		count_r += 1
	else:
		break
for i in range(n - 1, 0, -1):
	if int(arr[i]) <= k:
		count_l += 1
	else:
		break
if count_r == n or count_l == n:
	print(n)
else:
	print(count_l + count_r)


(n, m) = input().split()
n = int(n)
m = int(m)
count = 0
l = input().split()
l = [int(i) for i in l]
begin = 0
end = n - 1
while True:
	if l[begin] <= m:
		count += 1
		begin = begin + 1
	elif l[end] <= m:
		count += 1
		end = end - 1
	else:
		break
	if begin == n or end == -1:
		break
print(count)


(n, k) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
l = []
m = []
if a[0] <= k or a[-1] <= k:
	for i in a:
		if i > k:
			break
		else:
			l.append(i)
	for j in range(len(a) - 1, -1, -1):
		if a[j] > k:
			break
		else:
			m.append(a[j])
if len(a) > len(m) or len(a) > len(l):
	print(len(l) + len(m))
else:
	print(len(a))


import sys

class main:

	def __init__(self):
		(n, k) = (int(s) for s in sys.stdin.readline().rstrip().split(' '))
		problems = [int(s) for s in sys.stdin.readline().rstrip().split(' ')]
		begin = 0
		end = 0
		for (key, value) in enumerate(problems):
			if value > k:
				begin = key
				break
		for (key, value) in enumerate(problems[::-1]):
			if value > k:
				end = key
				break
		if problems[0] > k and problems[-1] > k:
			print(0)
		elif begin == 0 and end == 0:
			print(len(problems))
		else:
			print(begin + end)
		pass
main()


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
q = w = 0
for i in range(n):
	if a[i] > k:
		break
	q += 1
if q == n:
	print(n)
else:
	a.reverse()
	for i in range(n):
		if a[i] > k:
			break
		w += 1
	print(q + w)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
if max(l) <= k:
	print(n)
else:
	while l[0] <= k or l[-1] <= k:
		if l[0] <= k:
			l = l[1:]
			c += 1
		else:
			l = l[:len(l) - 1]
			c += 1
	print(c)


(n, k) = input().split()
n = int(n)
k = int(k)
num = 0
inp = input().split()
q = []
for i in inp:
	q.append(int(i))
while len(q) > 0:
	if q[0] <= k:
		q.pop(0)
		num += 1
	elif q[-1] <= k:
		q.pop(-1)
		num += 1
	elif q[0] > k and q[-1] > k:
		break
print(num)


from collections import defaultdict

def main():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	L = 0
	R = n - 1
	res = 0
	while L <= R:
		if a[L] <= k:
			res += 1
			L += 1
		elif a[R] <= k:
			res += 1
			R -= 1
		else:
			break
	print(res)
main()


def solve(test):
	(n, k) = map(int, input().split())
	ans = 0
	a = list(map(int, input().split()))
	if k >= max(a):
		ans = n
	else:
		for i in range(n):
			if a[i] <= k:
				ans += 1
			else:
				break
		for i in range(n - 1, -1, -1):
			if a[i] <= k:
				ans += 1
			else:
				break
	print(ans)
t = 1
for _ in range(t):
	solve(_ + 1)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
i = 0
j = n - 1
m = 0
while (a[i] <= k or a[j] <= k) and i <= j:
	if i == j:
		print(m + 1 if a[i] <= k else m)
		exit()
	if a[i] <= k:
		m += 1
		i += 1
	elif a[j] <= k:
		m += 1
		j -= 1
print(m)


(z, w, m) = (input, int, sorted)
(a, b) = map(int, z().split())
l = list(map(int, z().split()))
c = 0
d = 0
for i in l:
	if i <= b:
		c += 1
	else:
		break
for i in l[::-1]:
	if i <= b:
		c += 1
	else:
		break
if c >= a:
	c = a
print(c)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
f = f1 = -1
for i in range(n):
	if f == -1:
		if a[i] > k:
			f = i
	if f1 == -1:
		if a[n - i - 1] > k:
			f1 = i
print(f + f1 if f + f1 >= 0 else n)


(n, m) = map(int, input().split())
ls = list(map(int, input().split()))
cnt = 0
(L, R) = (0, n - 1)
while L < n and ls[L] <= m:
	L += 1
	cnt += 1
while R > L and ls[R] <= m:
	R -= 1
	cnt += 1
print(cnt)


def inp():
	return map(int, input().split())
(n, k) = inp()
a = list(inp())
ans = 0
i = 0
while i != n and a[i] <= k:
	ans += 1
	i += 1
j = n - 1
while i < j and a[j] <= k:
	ans += 1
	j -= 1
print(ans)


x = input().split()
n = int(x[0])
k = int(x[1])
c = 0
y = input().split()
for i in range(n):
	y[i] = int(y[i])
for j in range(n):
	if y[j] <= k:
		c += 1
	else:
		w = j
		break
if c != n:
	for q in range(n):
		if y[n - 1 - q] <= k and n - 1 - q > w:
			c += 1
		else:
			break
print(c)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	(n, k) = LI()
	l1 = LI()
	l2 = copy.deepcopy(l1)
	l2.reverse()
	mx1 = mx2 = 0
	f = True
	for (i, x) in enumerate(l1):
		if k < x:
			f = False
			mx1 = max(mx1, i)
			break
	if f:
		return n
	for (i, x) in enumerate(l2):
		if k < x:
			f = False
			mx2 = max(mx2, i)
			break
	if f:
		return n
	return mx1 + mx2
print(main())


__author__ = 'Dilshod'
(n, k) = map(int, input().split())
m = list(map(int, input().split()))
cnt = 0
for i in range(n):
	if m[0] <= m[-1] and m[0] <= k:
		del m[0]
		cnt += 1
	elif m[0] > m[-1] and m[-1] <= k:
		del m[-1]
		cnt += 1
print(cnt)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
(i, ans) = (0, 0)
while a[i] <= k and i < n - 1:
	ans += 1
	i += 1
while a[n - 1] <= k and n - 1 >= i:
	ans += 1
	n = n - 1
print(ans)


(n, k) = map(int, input().split())
m = 0
a = [int(i) for i in input().split()]
while a[0] <= k:
	m += 1
	del a[0]
	n -= 1
	if n == 0:
		break
if n > 0:
	while a[n - 1] <= k:
		m += 1
		del a[n - 1]
		n -= 1
		if n == 0:
			break
print(m)


input = __import__('sys').stdin.readline
MIS = lambda : map(int, input().split())
(n, k) = MIS()
prob = list(MIS())
while prob and prob[0] <= k:
	prob.pop(0)
while prob and prob[-1] <= k:
	prob.pop()
print(n - len(prob))


(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
f1 = 0
f2 = 0
for i in range(n):
	if a[i] <= k:
		f1 += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		f2 += 1
	else:
		break
print(f1 + f2 if f1 + f2 <= n else n)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
while len(a) != 0:
	if k >= a[0]:
		count += 1
		a.pop(0)
	elif k >= a[-1]:
		count += 1
		a.pop()
	else:
		break
print(count)


a = input().split()
n = int(a[0])
k = int(a[1])
a = input().split()
x = 0
z = 0
while x < 2:
	if len(a) == 0:
		break
	if x == 0:
		if int(a[0]) <= k:
			z += 1
			a = a[1:]
		else:
			x = 1
	if x == 1:
		if int(a[-1]) <= k:
			z += 1
			a = a[:-1]
		else:
			x = 2
print(z)


(n, po) = list(map(int, input().split()))
op = list(map(int, input().split()))
kam = len(op)
cou = 0
for x in range(kam):
	if len(op) > 1:
		if op[0] <= po:
			op.remove(op[0])
			cou += 1
		elif op[-1] <= po:
			op[-1] = 555555
			op.remove(op[-1])
			cou += 1
		else:
			print(cou)
			break
	elif len(op) == 1:
		if op[0] <= po:
			cou += 1
			print(cou)
			break
		else:
			print(cou)
			break
	else:
		print(cou)
		break


(n, k) = map(int, input().split())
a = ''.join(map(lambda x: '01'[int(x) <= k], input().split()))
print(n if '0' not in a else n - a.rindex('0') + a.index('0') - 1)


from bisect import bisect
from collections import defaultdict
from math import gcd, sqrt, ceil
from collections import Counter
import sys
sys.setrecursionlimit(10 ** 9)
(n, k) = map(int, input().split())
l = list(map(int, input().split()))
count = 0
while True:
	if l[-1] <= k:
		count += 1
		l.pop()
	elif l[0] <= k:
		count += 1
		l.pop(0)
	else:
		break
	if l == []:
		break
print(count)


def I():
	return map(int, input().split())
(n, k) = I()
a = list(I())
while a:
	if a[0] <= k:
		a.pop(0)
	elif a[-1] <= k:
		a.pop(-1)
	else:
		break
print(n - len(a))


(n, k) = input().split()
n = int(n)
k = int(k)
l = [int(x) for x in input().split()]
c = 0
while True:
	x = len(l)
	if x == 0:
		break
	if l[0] <= k:
		del l[0]
		c += 1
		continue
	if l[x - 1] <= k:
		del l[x - 1]
		c += 1
		continue
	else:
		break
print(c)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
while a:
	if a[0] > k and a[-1] > k:
		break
	if a[0] <= k:
		a.pop(0)
		c += 1
	elif a[-1] <= k:
		a.pop()
		c += 1
print(c)


(n, k) = map(int, input().split())
(l, c) = (list(map(int, input().split())), 0)
for i in l:
	if i <= k:
		c += 1
	else:
		break
if c == n:
	print(c)
else:
	l = l[::-1]
	for i in l:
		if i <= k:
			c += 1
		else:
			break
	print(c)


(n, k) = input().split()
n = int(n)
k = int(k)
a = [int(i) for i in input().split()]
schet = 0
o = 0
while o < n and a[o] <= k:
	schet = schet + 1
	o = o + 1
o = -1
while o > -n - 1 and a[o] <= k:
	schet = schet + 1
	o = o - 1
if schet > n:
	print(n)
else:
	print(schet)


n = input()
(n, k) = n.split()
(n, k) = (int(n), int(k))
y = input().split()
x = []
for i in range(n):
	x.append(int(y[i]))
count = 0
flag = 0
for i in range(n):
	if x[i] > k:
		flag = i
		break
	count += 1
	if i == n - 1:
		flag = n
for i in range(n - 1, flag, -1):
	if x[i] > k:
		break
	count += 1
print(count)


(n, k) = [int(i) for i in input().split()]
arr = [int(i) for i in input().split()]
count = 0
while len(arr) > 0 and arr[0] <= k:
	count += 1
	arr.pop(0)
while len(arr) > 0 and arr[-1] <= k:
	count += 1
	arr.pop(-1)
print(count)


p = [int(n) for n in input().split()]
d = [int(m) for m in input().split()]
count = 0
for i in range(len(d)):
	if d[i] <= p[1]:
		count = count + 1
	else:
		break
j = len(d) - 1
while j > i:
	if d[j] <= p[1]:
		count = count + 1
	else:
		break
	j = j - 1
print(count)


(n, k) = [int(x) for x in input().split(' ')]
a = [int(x) for x in input().split(' ')]
cnt = 0
for i in range(len(a)):
	if a[0] <= k:
		cnt += 1
		a.pop(0)
	if len(a) > 0 and a[len(a) - 1] <= k:
		cnt += 1
		a.pop()
	if len(a) == 0 or (a[0] > k and a[len(a) - 1] > k):
		break
print(cnt)


s = input().split()
n = int(s[0])
k = int(s[1])
arr = []
s = input().split()
for i in range(n):
	arr.append(int(s[i]))
counter = 0
i = 0
left = n
while i < n:
	if arr[i] <= k:
		counter += 1
	else:
		if i > 0:
			left = i - 1
		else:
			left = 0
		break
	i += 1
i = n - 1
while i > left:
	if arr[i] <= k:
		counter += 1
	else:
		break
	i -= 1
print(counter)


(n, k) = map(int, input().split())
dilema = [int(x) for x in input().split()]
l = 0
rezistor = 0
for x in dilema:
	if x <= k:
		rezistor += 1
		l += 1
	else:
		break
if n != l:
	for x in range(n):
		n -= 1
		if dilema[n] <= k:
			rezistor += 1
		else:
			break
			print('why im here')
print(rezistor)


problemList = []
n = 0
k = 0

def FindMax(l: int, r: int):
	ret = 0
	side = l
	twoSidesBlocked = 0
	while l <= r:
		if side == l and problemList[l] <= k:
			ret += 1
			l += 1
			side = l
			twoSidesBlocked = 0
		elif side == l:
			if twoSidesBlocked == 1:
				break
			side = r
			twoSidesBlocked += 1
		elif side == r and problemList[r] <= k:
			ret += 1
			r -= 1
			side = r
			twoSidesBlocked = 0
		elif side == r:
			if twoSidesBlocked == 1:
				break
			side = l
			twoSidesBlocked += 1
	return ret
(n, k) = map(int, input().split())
n = int(n)
k = int(k)
problemList = list(map(int, input().split()))
result = FindMax(0, n - 1)
print(result)


(a, b) = input().split()
a = int(a)
b = int(b)
x = [int(x) for x in input().split()]
cnt = 0
for i in x:
	if i <= b:
		cnt = cnt + 1
	else:
		break
x.reverse()
for j in x:
	if j <= b:
		cnt = cnt + 1
	else:
		break
if cnt > a:
	print(a)
else:
	print(cnt)


import collections

class Solution:

	def solve(self, n, k, problems):
		i = 0
		j = n - 1
		ans = 0
		while i <= j:
			leftProblemDifficulty = problems[i]
			rightProblemDifficulty = problems[j]
			if leftProblemDifficulty <= k:
				i += 1
				ans += 1
			elif rightProblemDifficulty <= k:
				j -= 1
				ans += 1
			else:
				break
		return ans
sol = Solution()
[n, k] = list(map(int, input().strip().split()))
problems = list(map(int, input().strip().split()))
print(sol.solve(n, k, problems))


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
l = []
m = []
for i in range(a):
	if c[i] > b:
		break
	else:
		l.append(1)
for i in range(a - 1, -1, -1):
	if c[i] > b:
		break
	else:
		m.append(1)
if sum(l) == a:
	print(a)
else:
	print(sum(l) + sum(m))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
while c < n and a[c] <= k:
	c += 1
c1 = n - 1
while c1 > c and a[c1] <= k:
	c1 -= 1
print(c + n - 1 - c1)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
i = 0
while i < n and a[i] <= m:
	count += 1
	i += 1
j = n - 1
while j > i and a[j] <= m:
	count += 1
	j -= 1
print(count)


def main():
	(n, k) = list(map(int, input().split()))
	A = list(map(int, input().split()))
	(tusk_left, tusk_right) = (0, 0)
	for i in A:
		if i <= k:
			tusk_left += 1
		else:
			break
	for i in range(n - 1, -1, -1):
		if A[i] <= k:
			tusk_right += 1
		else:
			break
	print(min(tusk_left + tusk_right, n))
main()


a = [int(q) for q in input().strip().split()]
b = [int(q) for q in input().strip().split()]
ct = 0
while len(b) > 0:
	if b[0] <= a[1]:
		b.remove(b[0])
		ct += 1
	else:
		break
b = b[::-1]
while len(b) > 0:
	if b[0] <= a[1]:
		b.remove(b[0])
		ct += 1
	else:
		break
print(ct)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
count1 = 0
count2 = 0
for i in a:
	if i <= k:
		count1 += 1
	else:
		break
for i in reversed(a):
	if i <= k:
		count2 += 1
	else:
		break
if count1 + count2 > n:
	print(n)
else:
	print(count1 + count2)


def solve(i, j):
	if num[i] > k and num[j] > k:
		return 0
	if i > j:
		return 0
	elif i == j:
		return 1 if num[i] <= k else 0
	a = 0
	b = 0
	if num[i] <= k:
		a = 1
		i += 1
	if num[j] <= k:
		b = 1
		j -= 1
	return a + b + solve(i, j)
(n, k) = [int(i) for i in input().split()]
num = [int(i) for i in input().split()]
print(solve(0, n - 1))


(n, k) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
count = 0
while True:
	if a[0] > k and a[-1] > k:
		break
	if a[0] <= k:
		count += 1
		del a[0]
	if len(a) == 0:
		break
	if a[-1] <= k:
		count += 1
		del a[-1]
	if len(a) == 0:
		break
print(count)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
c = 0
for d in a:
	if d <= k:
		c += 1
	else:
		for d in a[::-1]:
			if d <= k:
				c += 1
			else:
				break
		break
print(c)


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
DIRECTIONS = [[0, 1], [0, -1], [1, 0], [1, -1]]
NEIGHBOURS = [(i, j) for i in range(-1, 2) for j in range(-1, 2) if i != 0 or j != 0]
OrdUnicode_a = ord('a')
OrdUnicode_A = ord('A')
CAPS_ALPHABETS = {chr(i + OrdUnicode_A): i for i in range(26)}
SMOL_ALPHABETS = {chr(i + OrdUnicode_a): i for i in range(26)}
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0) + 1
INFINITY = float('inf')
(n, k) = get_ints()
li = get_list()
ans = 0
for i in li:
	if i > k:
		break
	ans += 1
for i in li[::-1]:
	if i > k:
		break
	ans += 1
print(min(ans, n))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
result = status = 0
for i in range(n):
	if a[i] > k:
		result += i
		status = 1
		break
a.reverse()
for i in range(n):
	if a[i] > k:
		result += i
		break
if status == 1:
	print(result)
else:
	print(n)


yoar = list(map(int, input().split()))
n = yoar[0]
k = yoar[1]
arr = list(map(int, input().split()))
l = -1
r = n
ans = 0
for i in range(n):
	if arr[i] <= k:
		l = i
		continue
	else:
		break
for i in range(n - 1, i, -1):
	if arr[i] <= k:
		r = i
		continue
	else:
		break
ans = l + 1 + (n - r)
print(ans)


(n, k) = map(int, input().split())
x = list(map(int, input().split()))
cnt = 0
flag = False
for i in range(n):
	if x[i] <= k:
		cnt += 1
	else:
		x.reverse()
		for j in range(n):
			if x[j] <= k:
				cnt += 1
			else:
				break
		break
print(cnt)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
ans = 0
j = 0
for i in range(n):
	if a[i] > k:
		j = i
		break
	ans += 1
else:
	j = n
for i in range(n - 1, 0, -1):
	if j > i or a[i] > k:
		break
	ans += 1
print(ans)


def prog():
	(n, k) = map(int, input().split())
	mas = list(map(int, input().split()))
	rez = 0
	for i in range(n):
		if mas[0] <= k:
			rez += 1
			mas.pop(0)
		else:
			break
	for i in range(len(mas) - 1, -1, -1):
		if mas[i] <= k:
			rez += 1
			mas.pop()
		else:
			break
	print(rez)
prog()


from collections import deque

def count_problems(n, k):
	q = deque(n)
	cnt = 0
	while q:
		if q[0] <= k:
			q.popleft()
			cnt += 1
		elif q[-1] <= k:
			q.pop()
			cnt += 1
		else:
			break
	print(cnt)
(n, k) = list(map(int, input().split()))
problems = list(map(int, input().split()))
count_problems(problems, k)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
b = [x > k for x in a]
if not any(b):
	print(n)
else:
	l = b.index(True)
	r = n - b[::-1].index(True) - 1
	c = r - l + 1
	print(n - c)


(n, k) = map(int, input().split())
ar = list(map(int, input().split()))
i = 0
for x in ar:
	if x > k:
		break
	i += 1
ans = i
for x in ar[::-1]:
	if x > k:
		break
	ans += 1
ans = min(n, ans)
print(ans)


(a, b) = [int(i) for i in input().split()]
S = [int(i) for i in input().split()]
k = 0
while 1:
	if len(S) == 0:
		break
	if S[0] <= b:
		k += 1
		S = S[1:]
	else:
		break
while 1:
	if len(S) == 0:
		break
	if S[-1] <= b:
		k += 1
		S = S[:-1]
	else:
		break
print(k)


(n, k) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
i = 0
while i < len(a):
	if a[i] > k:
		break
	i += 1
count = i
j = len(a) - 1
while j >= i:
	if a[j] > k:
		break
	count += 1
	j -= 1
print(count)


l1 = list(map(int, input().split()))
l = list(map(int, input().split()))
c = 0
for i in range(l1[0]):
	if l[-i - 1] <= l1[1]:
		c += 1
	else:
		break
for i in range(l1[0]):
	if c == len(l):
		break
	if l[i] <= l1[1]:
		c += 1
	else:
		break
print(c)


rd = lambda : list(map(int, input().split()))
(n, k) = rd()
a = rd()
ans = 0
for i in range(0, n - 1):
	if a[i] <= k:
		ans += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		ans += 1
	else:
		break
print(min(ans, n))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
(l, r) = (0, 0)
(bl, br) = (0, n)
for i in range(n):
	if a[i] > k:
		break
	l += 1
	bl = i
for i in range(n - 1, -1, -1):
	if a[i] > k:
		break
	r += 1
	br = i
if bl < br:
	print(l + r)
else:
	print(l)


(n, k) = map(int, input().split())
s = list(map(int, input().split()))
ans = 0
x = n - 1
while x > -1:
	if s[x] <= k:
		ans += 1
		x -= 1
	else:
		break
x1 = x
for i in range(x1):
	if s[i] <= k:
		ans += 1
	else:
		break
print(ans)


(n, k) = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
res = 0
i = 0
while i < n and l[i] <= k:
	i += 1
res = i
if i != n:
	i = n - 1
	while l[i] <= k:
		i -= 1
	res += max(0, n - i - 1)
print(res)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
for i in a:
	if i > k:
		c += 1
if c == 0:
	print(n)
else:
	for i in range(0, n):
		if a[i] > k:
			c = i
			break
	for i in range(n - 1, -1, -1):
		if a[i] > k:
			d = i
			break
	ans = n - d + c - 1
	print(ans)


(n, k) = tuple(map(int, input().split()))
a = list(map(int, input().split()))
left = -1
for i in range(n):
	if a[i] > k:
		left = i
		break
right = -1
for i in range(n - 1, -1, -1):
	if a[i] > k:
		right = i
		break
if left == -1 or right == -1:
	print(str(n))
else:
	print(str(n - (right - left + 1)))


a = input()
b = input()
list1 = a.split(' ')
n = int(list1[0])
k = int(list1[1])
list2 = b.split(' ')
L = int(list2[0])
R = int(list2[-1])
count = 0
while (L <= k or R <= k) and count < n:
	L = int(list2[0])
	R = int(list2[-1])
	if L <= k:
		list2.pop(0)
		count = count + 1
	elif R <= k:
		list2.pop(-1)
		count = count + 1
print(count)


(a, b) = input().split()
(a, b) = (int(a), int(b))
k = 0
c = input().split()
for i in range(a):
	if int(c[i]) > b:
		break
	elif c[i] != '-1':
		if int(c[i]) <= b:
			c[i] = '-1'
			k += 1
for i in range(a):
	if int(c[-(i + 1)]) > b:
		break
	elif c[-(i + 1)] != '-1':
		c[-(i + 1)] = '-1'
		k += 1
print(k)


(n, k) = list(map(int, input().split()))
p = 0
a = list(map(int, input().split()))
q = [1] * n
for i in range(n):
	if a[i] > k:
		break
	elif q[i] != 0:
		q[i] = 0
		p += 1
for i in range(1, n + 1):
	if a[-i] > k:
		break
	elif q[-i] != 0:
		q[-i] = 0
		p += 1
print(p)


import logging
from collections import deque

def solve(sequence, k):
	n = len(sequence)
	q = deque(sequence)
	while q and (q[0] <= k or q[-1] <= k):
		if q[0] <= k:
			q.popleft()
		elif q[-1] <= k:
			q.pop()
	return n - len(q)

def main():
	(_, k) = map(int, input().strip().split())
	sequence = [int(x) for x in input().strip().split()]
	result = solve(sequence, k)
	print(result)
main()


from collections import Counter, defaultdict
BS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def to_base(s, b):
	res = ''
	while s:
		res += BS[s % b]
		s //= b
	return res[::-1] or '0'
alpha = 'abcdefghijklmnopqrstuvwxyz'
from math import floor, ceil, pi
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919]

def primef(n, plst=[]):
	if n == 1:
		return plst
	else:
		for m in primes:
			if n % m == 0:
				return primef(n // m, plst + [m])
		return primef(1, plst + [n])

def scoreBad(s):
	res = 0
	counter = 0
	while True:
		cur = int(counter)
		ok = True
		for i in range(len(s)):
			res += 1
			if s[i] == '+':
				cur += 1
			else:
				cur -= 1
			if cur < 0:
				ok = False
				break
		counter += 1
		if ok:
			break
	return res

def lmii():
	return list(map(int, input().split()))

def ii():
	return int(input())
(n, m) = lmii()
nums = lmii()
tot = 0
while nums:
	a = nums.pop(0)
	if a <= m:
		tot += 1
	else:
		break
while nums:
	a = nums.pop(-1)
	if a <= m:
		tot += 1
	else:
		break
print(tot)


(n, k) = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
t = 0
end = len(l)
p = 0
while p < end and l[p] <= k:
	t += 1
	p += 1
if p != end:
	p = end - 1
	while p > 0 and l[p] <= k:
		t += 1
		p -= 1
print(t)


(n, k) = [int(i) for i in input().split()]
tasks = [int(i) for i in input().split()]
count = 0
while len(tasks) != 1 and tasks[0] <= k:
	count += 1
	del tasks[0]
	if len(tasks) == 0:
		break
while len(tasks) != 1 and tasks[len(tasks) - 1] <= k:
	count += 1
	del tasks[len(tasks) - 1]
	if len(tasks) == 0:
		break
if len(tasks) == 1:
	if tasks[0] <= k:
		count += 1
print(count)


import re
import math
import decimal
import bisect

def read():
	return input().strip()

def iread():
	return int(input().strip())

def viread():
	return list(map(int, input().strip().split()))
from collections import deque
(n, k) = viread()
d = deque(viread())
solved = 0
while len(d) != 0 and (d[0] <= k or d[-1] <= k):
	if d[0] <= k:
		d.popleft()
		solved += 1
	elif d[-1] <= k:
		d.pop()
		solved += 1
print(solved)


(n, k) = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
l = 0
r = n - 1
ans = 0
while l <= r and (q[l] <= k or q[r] <= k):
	if l == r:
		ans += 1
		break
	if q[l] <= k:
		ans += 1
		l += 1
	if q[r] <= k:
		ans += 1
		r -= 1
print(ans)


(n, d) = map(int, input().split())
a = list(map(int, input().split()))
if max(a) <= d:
	print(n)
	exit()
while a[0] <= d:
	a = a[1:]
while a[-1] <= d:
	a = a[:-1]
print(n - len(a))


(n, h) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
while i < n and a[i] <= h:
	i += 1
m = n - 1
while m > i and a[m] <= h:
	m -= 1
print(n - (m - i + 1))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
i = 0
j = n - 1
while True:
	if a[i] > k and a[j] > k:
		break
	elif a[j] > k:
		s += 1
		i += 1
	elif a[i] > k:
		s += 1
		j -= 1
	else:
		s += 1
		i += 1
	if i == n:
		break
print(s)


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
dict1 = {}
ans1 = 0
flag1 = 0
for i in range(n):
	if arr[i] > k:
		ans1 = i
		flag1 = 1
		break
ans2 = 0
flag2 = 0
for i in range(n - 1, -1, -1):
	if arr[i] > k:
		ans2 = n - 1 - i
		flag2 = 1
		break
if flag1 == 0 or flag2 == 0:
	print(n)
else:
	print(ans1 + ans2)


(n, m) = map(int, input().split())
l = [int(x) for x in input().split()]
z = 0
for i in range(0, len(l)):
	if m >= l[i]:
		z += 1
	else:
		break
x = 0
for i in range(len(l) - 1, -1, -1):
	if m >= l[i]:
		x += 1
	else:
		break
if x + z > len(l):
	print(z)
else:
	print(x + z)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(0, len(a)):
	if a[i] <= m:
		count = count + 1
	else:
		break
if count == len(a):
	print(count)
	exit()
a.reverse()
for i in range(0, len(a)):
	if a[i] <= m:
		count = count + 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
x = input()
x = x.split(' ')
flag1 = -1
flag2 = -1
count = 0
for i in range(len(x)):
	if int(x[i]) <= k and flag1 == -1:
		count += 1
	if int(x[i]) > k and flag1 == -1:
		flag1 = i
x.reverse()
for j in range(len(x)):
	if int(x[j]) <= k and flag1 != -1 and (flag2 == -1):
		count += 1
	if int(x[j]) > k and flag1 != -1 and (flag2 == -1):
		flag2 = j
print(count)


(n, k) = map(int, input().split(' '))
list1 = list(map(int, input().split(' ')))
(p, c) = (0, 0)
for j in range(n):
	if list1[j] > k:
		p += 1
		break
	else:
		c += 1
if p == 0:
	print(c)
else:
	for j in range(n - 1, 0, -1):
		if list1[j] > k:
			break
		else:
			c += 1
	print(c)


(n, k) = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]
s = 0
for i in L:
	if i > k:
		s += 1
if s == 0:
	print(n)
elif s == 1:
	print(n - 1)
else:
	left = 0
	right = n - 1
	while left < n:
		if L[left] > k:
			break
		left += 1
	while right > -1:
		if L[right] > k:
			break
		right -= 1
	print(left + (n - 1 - right))


from collections import deque
(n, k) = list(map(int, input().split()))
l = deque(map(int, input().split()))
count = 0
while l:
	if l[0] <= k or l[-1] <= k:
		if l[0] >= l[-1]:
			l.pop()
		else:
			l.popleft()
		count += 1
	else:
		break
print(count)


from sys import stdin, stdout
from collections import deque
read = stdin.readline
write = stdout.write
print = lambda x: write(str(x) + '\n')

def readint():
	return int(read())

class Sol:

	@classmethod
	def input(cls):
		return cls()

	def solve(self):
		(n, k) = map(int, read().split())
		arr = deque(map(int, read().split()))
		try:
			while arr[-1] <= k:
				arr.pop()
			while arr[0] <= k:
				arr.popleft()
			return n - len(arr)
		except IndexError:
			return n
print(Sol.input().solve())


def main():
	[n, k] = [int(_) for _ in input().split()]
	problems = [int(_) for _ in input().split()]
	try:
		a = next((i for i in range(n) if problems[i] > k))
		b = next((j for j in range(n - 1, -1, -1) if problems[j] > k))
		print(a + (n - 1 - b))
	except StopIteration:
		print(n)
main()


from collections import deque
(n, k) = [int(i) for i in input().split()]
seq = deque((int(i) for i in input().split()))
while seq:
	if k >= seq[0]:
		seq.popleft()
	elif k >= seq[-1]:
		seq.pop()
	else:
		break
print(n - len(seq))


st = [int(i) for i in input().split(' ')]
n = st[0]
k = st[1]
t = 0
a = [int(n) for n in input().split(' ')]
for i in range(n):
	if a[i] > k:
		break
	t += 1
a = a[::-1]
for i in range(n):
	if a[i] > k:
		break
	t += 1
if t == 2 * len(a):
	t = t / 2
print(int(t))


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
head = 0
tail = len(a) - 1
res = 0
while 1:
	if res == len(a):
		break
	if a[head] <= m:
		res += 1
		head += 1
	elif a[tail] <= m:
		tail -= 1
		res += 1
	else:
		break
print(res)


(n, k) = map(int, input().split())
A = [int(x) for x in input().split()]
if max(A) <= k:
	print(n)
else:
	result = 0
	i = 0
	while A[i] <= k:
		result += 1
		i += 1
	i = n - 1
	while A[i] <= k:
		result += 1
		i -= 1
	print(result)


(N, K) = map(int, input().split(' '))
array = [int(i) for i in input().split(' ')]
i = 0
count = 0
while i < N and array[i] <= K:
	count += 1
	i += 1
j = N - 1
while j >= i and array[j] <= K:
	count += 1
	j -= 1
print(count)


l = [int(num) for num in input().split()]
l1 = [int(num) for num in input().split()]
count1 = 0
count2 = 0
for i in range(l[0]):
	if l1[i] <= l[1]:
		count1 += 1
	else:
		break
for i in range(l[0]):
	if l1[l[0] - 1 - i] <= l[1]:
		count2 += 1
	else:
		break
if count1 == l[0]:
	print(count1)
else:
	print(count1 + count2)


(n, k) = map(int, input().split())
problems = list(map(int, input().split()))
(left, right) = (0, n)
for i in range(n):
	if k < problems[i]:
		break
	left += 1
for i in range(n):
	if k < problems[n - 1 - i]:
		break
	right -= 1
if left == n:
	print(n)
else:
	print(n - (right - left))


from collections import deque
(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
a = deque(a)
ans = 0
while len(a) > 0:
	x = a[0]
	if x <= k:
		a.popleft()
		ans += 1
	else:
		x = a[-1]
		if x <= k:
			a.pop()
			ans += 1
		else:
			break
print(ans)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
from collections import Counter
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
(n, k) = iia()
arr = iia()
res = 0
while len(arr):
	if arr[0] <= k:
		arr.pop(0)
		res += 1
	elif arr[-1] <= k:
		arr.pop()
		res += 1
	else:
		break
print(res)


NK = list(map(int, input().split()))
ith = list(map(int, input().split()))
i = 0
while len(ith) > 0:
	if ith[0] <= NK[1]:
		del ith[0]
	elif ith[-1] <= NK[1]:
		del ith[-1]
	elif ith[-1] > NK[1] and ith[0] > NK[1]:
		break
	i += 1
print(i)


(n, k) = input().split()
s = [int(w) for w in input().split()]
n = int(n)
k = int(k)
fl = False
fr = False
for i in range(n):
	if s[i] > k:
		left = i
		fl = True
		break
for i in range(n):
	if s[n - 1 - i] > k:
		right = n - 1 - i
		fr = True
		break
if fl == False and fr == False:
	print(n)
else:
	print(left + n - 1 - right)


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
b = arr[:]
cnt = 0
for i in b:
	if i > k:
		break
	else:
		arr.remove(i)
		cnt += 1
for i in range(len(arr) - 1, -1, -1):
	if arr[i] > k:
		break
	else:
		arr.pop()
		cnt += 1
print(cnt)


i = list(map(int, input().strip().split()))
j = list(map(int, input().strip().split()))
count = 0
q = 0
while j[q] <= i[1]:
	count = count + 1
	del j[q]
	try:
		j[q]
	except:
		break
q = len(j) - 1
if q >= 0:
	while j[q] <= i[1]:
		count = count + 1
		del j[q]
		q = q - 1
		if q == 0:
			break
print(count)


def main():
	(n, k) = map(int, input().split(' '))
	total = 0
	list1 = list(map(int, input().split(' ')))
	for i in range(n):
		if list1[i] <= k:
			total = total + 1
		else:
			break
	for i in range(n - 1, 0, -1):
		if list1[i] <= k:
			total = total + 1
		else:
			break
	if total > n:
		total = n
	print(int(total))
main()


(n, m) = map(int, input().split())
S = input()
a = [int(i) for i in S.split()]
ans = 0
for i in range(n):
	if a[i] <= m:
		ans += 1
	else:
		break
if ans < n:
	for i in reversed(a):
		if i <= m:
			ans += 1
		else:
			break
print(ans)


(n, k) = map(int, input().split())
L = list(map(int, input().split()))
i = 0
m = n - 1
while m > i and (L[i] <= k or L[m] <= k):
	if L[i] <= k:
		i += 1
	elif L[m] <= k:
		m -= 1
if i == m:
	if L[i] <= k:
		print(i + n - m)
	else:
		print(i + n - m - 1)
else:
	print(i + n - m - 1)


from sys import stdin, stdout

def main():
	(a, k) = map(int, input().split())
	ans = 0
	arr = [int(x) for x in stdin.readline().split()]
	while len(arr) > 0:
		if k >= arr[len(arr) - 1]:
			ans += 1
			arr.pop(len(arr) - 1)
		elif k >= arr[0]:
			ans += 1
			arr.pop(0)
		else:
			break
	stdout.write(str(ans))
main()


(n, k) = map(int, input().split())
arr = [int(X) for X in input().split()]
flag = 1
no = 0
while True:
	if arr == []:
		break
	if arr[0] <= k:
		del arr[0]
		no += 1
	elif arr[-1] <= k:
		del arr[-1]
		no += 1
	else:
		break
print(no)


(n, k) = map(int, input().split())
c = 0
a = list(map(int, input().split()))
j = n - 1
i = 0
while True:
	if a[i] <= k:
		c += 1
		i += 1
	elif a[j] <= k:
		c += 1
		j -= 1
	if i > j or (a[j] > k and a[i] > k):
		break
print(c)


def main():
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	start = 0
	end = n
	while start < n and a[start] <= k:
		start += 1
	while end >= 0 and a[end - 1] <= k:
		end -= 1
	if end <= start:
		print(n)
		return 0
	print(n - end + start)
	return 0
main()


(n, k) = map(int, input().split())
ls = list(map(int, input().split()))
s = 0
for i in ls:
	if i > k:
		break
	s += 1
if s != n:
	for i in ls[::-1]:
		if i > k:
			break
		s += 1
print(s)


(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
flag = 0
count = 0
for i in range(len(a)):
	if a[i] <= k:
		count += 1
	else:
		start = i
		flag = 1
		break
if flag == 1:
	for i in range(len(a) - 1, start, -1):
		if a[i] <= k:
			count += 1
		else:
			break
print(count)


(n, k) = [int(i) for i in input().split()]
a = list(map(int, input().split()))
e = 0
t = 0
i = n - 1
while a[i] <= k and i >= 0:
	e = e + 1
	i = i - 1
a.reverse()
i = n - 1
while a[i] <= k and i >= 0:
	e = e + 1
	i = i - 1
print(min(n, e))


def main():
	(n, k) = [int(v) for v in input().split()]
	vals = [int(v) for v in input().split()]
	d = len(vals)
	while len(vals) != 0:
		changed = False
		c = vals[0]
		if c <= k:
			vals = vals[1:]
			changed = True
		if changed:
			continue
		c = vals[-1]
		if c <= k:
			vals = vals[:-1]
			changed = True
		if not changed:
			break
	print(d - len(vals))
main()


from sys import stdin, stdout
nk = list(map(int, stdin.readline().strip().split()))
n = nk[0]
k = nk[1]
diff_lst = list(map(int, stdin.readline().split()))
count = 0
i = 0
while diff_lst and (diff_lst[0] <= k or diff_lst[-1] <= k):
	if diff_lst[i] <= k:
		count += 1
		diff_lst.pop(i)
		if i != 0:
			i -= 1
	else:
		i = len(diff_lst) - i - 1
stdout.write(str(count))


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
count = 0
for i in range(n):
	if arr[i] <= k:
		count += 1
	else:
		break
arr = arr[::-1]
for i in range(n):
	if arr[i] <= k:
		count += 1
	else:
		break
if count == 2 * n:
	print(count // 2)
else:
	print(count)


tmp = input().split(' ')
n = int(tmp[0])
l = 0
k = int(tmp[1])
a = input().split(' ')
r = 0
for i in a:
	if int(i) <= k:
		r = r + 1
	else:
		break
for i in a[::-1]:
	if int(i) <= k and r != n:
		r = r + 1
	else:
		break
print(r)


(n, k) = input().split(' ')
n = int(n)
k = int(k)
c = input().split(' ', n)
c = list(map(int, c))
h = 0
l = 0
for i in range(0, n):
	if k > c[i] or k == c[i]:
		h += 1
		l = i
	else:
		l = i
		break
if l == 0 and l != n - 1:
	c.reverse()
	for i in c:
		if k > i or k == i:
			h += 1
		else:
			break
elif l != 0:
	for j in range(n - 1, l, -1):
		if k > c[j] or k == c[j]:
			h += 1
		else:
			break
print(h)


(n, d) = map(int, input().split())
a = list(map(int, input().split()))
c1 = 0
ans = 0
while c1 < n and a[c1] <= d:
	c1 += 1
	ans += 1
c2 = n - 1
while c2 > c1 and a[c2] <= d:
	c2 -= 1
	ans += 1
print(ans)


(n, k) = input().split()
(n, k) = (int(n), int(k))
problems = list(map(int, input().split()))
index = 0
reverse = n - 1
n = len(problems)
output = []
for i in range(n):
	if problems[index] <= k:
		output.append(problems[index])
		index += 1
	elif problems[reverse] <= k:
		output.append(problems[reverse])
		reverse -= 1
	else:
		break
print(len(output))


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
answer = 0
while n > 0 and l[0] <= k:
	answer += 1
	l = l[1:]
	n -= 1
while n > 0 and l[-1] <= k:
	answer += 1
	l = l[:n - 1]
	n -= 1
print(answer)


(a, b) = map(int, input().split())
ar = list(map(int, input().split()))
j = 0
count = 0
count1 = 0
for i in range(a):
	if ar[i] > b:
		j = i
		count1 = 1
		break
	else:
		count += 1
if count1 == 1:
	for i in range(a - 1, j, -1):
		if ar[i] > b:
			break
		else:
			count += 1
	print(count)
else:
	print(count)


(n, m) = list(map(int, input().split()))
arr = list(map(int, input().split()))
ul = 0
l = 0
for i in range(len(arr)):
	if arr[i] > m:
		break
	else:
		ul += 1
for i in reversed(arr):
	if i > m:
		break
	else:
		l += 1
print(min(n, ul + l))


import sys
(number_of_problems, skill) = [int(i) for i in input().split()]
problem_array = [int(p) for p in input().split()]
count = 0
running = True
while running:
	if len(problem_array) == 0:
		print(number_of_problems)
		sys.exit()
	elif problem_array[0] <= skill:
		count += 1
		del problem_array[0]
	elif problem_array[-1] <= skill:
		count += 1
		del problem_array[-1]
	else:
		running = False
print(count)


(n, k) = map(int, input().split(' '))
l = list(map(int, input().split(' ')))
c = 0
le = len(l)
while True:
	if le - c != 0 and l[0] <= k:
		del l[0]
		c += 1
	elif le - c != 0 and l[le - c - 1] <= k:
		del l[le - c - 1]
		c += 1
	else:
		break
print(c)


NK = [int(x) for x in input().split()]
list = [int(x) for x in input().split()]
n = NK[0]
k = NK[1]
leftPointer = 0
rightPointer = n
maxPL = 0
maxPR = 0
maxT = 0
if k >= max(list):
	print(n)
else:
	for i in list:
		if k >= i:
			maxPL += 1
		else:
			break
	for i in range(n - 1, 0, -1):
		if k >= list[i]:
			maxPR += 1
		else:
			break
	maxT = maxPL + maxPR
	print(maxT)


f = lambda : map(int, input().split())
(n, k) = f()
l = list(f())
l1 = ['1' if i <= k else '0' for i in l]
print(n - len(''.join(l1).strip('1')))


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
l = True
r = True
c = 0
while (l or r) and len(a) > 0:
	if a[0] <= k:
		c += 1
		a.pop(0)
		continue
	else:
		l = False
	if a[len(a) - 1] <= k:
		c += 1
		a.pop()
		continue
	else:
		r = False
print(c)


while True:
	try:
		(n, k) = map(int, input().split())
		lis = list(map(int, input().split()))
		ans = 0
		for i in range(n):
			if lis[i] > k:
				break
			ans = ans + 1
		lis = lis[::-1]
		for i in range(n):
			if lis[i] > k:
				break
			ans = ans + 1
		if ans > n:
			ans = n
		print(ans)
	except:
		break


b = []
(m, k) = input().split()
count = 0
b = list(map(int, input().split()))
for i in range(int(m)):
	if int(k) >= b[i]:
		count = count + 1
	else:
		for j in range(int(m) - i):
			if int(k) >= b[int(m) - j - 1]:
				count = count + 1
			else:
				break
		break
print(count)


(N, K) = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
j1 = 1
j2 = 1
co = 0
if N % 2 == 0:
	M = N // 2
else:
	M = N // 2 + 1
i = 0
while j1 != 0 and i < N:
	if a[i] <= K and j1 == 1:
		co = co + 1
	else:
		j1 = 0
		pos = i
	i = i + 1
if j1 == 0:
	i = pos + 1
	j = N - 1
	while j >= i and j2 != 0:
		if a[j] <= K and j2 == 1:
			co = co + 1
		else:
			j2 = 0
		j = j - 1
print(co)


(n, k) = map(int, input().split())
arr = [int(x) for x in input().split()]
ctr = 0
ptr = 0
while ptr < n and arr[ptr] <= k:
	ctr += 1
	ptr += 1
mark = ctr
ptr = n - 1
while arr[ptr] <= k and ptr >= mark:
	ptr -= 1
	ctr += 1
print(ctr)


(n, k) = map(int, input().split())
p = list(map(int, input().split()))
total = 0
for dif in p:
	if dif > k:
		break
	total += 1
for remaining in p[total:][::-1]:
	if remaining > k:
		break
	total += 1
print(total)


(n, k) = map(int, input().split())
hard = list(map(int, input().split()))
sum = 0
for l in hard:
	if l <= k:
		sum += 1
	else:
		break
if sum == n:
	print(sum)
else:
	for t in range(n - 1, -1, -1):
		if hard[t] <= k:
			sum += 1
		else:
			break
	print(sum)


(a, max) = map(int, input().split())
ls = list(map(int, input().split()))
count = 0
for el in ls:
	if el <= max:
		count += 1
	else:
		break
ls = ls[count:]
for el in ls[::-1]:
	if el <= max:
		count += 1
	else:
		break
print(count)


(num, max_chislo) = map(int, input().split())
list_chisla = list(map(int, input().split()))
x = 0
a = 1
i = 0
z = 0
while num != 0:
	if list_chisla[i] <= max_chislo and a != 0:
		x += 1
		i += 1
	else:
		i = z
		a = 0
		if list_chisla[-1 - i] <= max_chislo:
			x += 1
			z += 1
		else:
			break
	num -= 1
print(x)


import sys
lines = [line.strip() for line in sys.stdin.readlines()]
(n, k) = list(map(int, lines[0].split(' ')))
tasks = list(map(int, lines[1].split(' ')))
done_tasks = 0
while tasks:
	if tasks[0] <= k:
		del tasks[0]
		done_tasks += 1
	elif tasks[-1] <= k:
		del tasks[-1]
		done_tasks += 1
	else:
		break
print(done_tasks)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
p = 0
f = 0
while f < n and a[f] <= k:
	p += 1
	f += 1
f = n - 1
while f >= 0 and a[f] <= k:
	p += 1
	f -= 1
if p > n:
	print(p // 2)
else:
	print(p)


from sys import stdin
from math import *
line = stdin.readline().rstrip().split()
n = int(line[0])
k = int(line[1])
numbers = list(map(int, stdin.readline().rstrip().split()))
cant = 0
for num in numbers:
	if num > k:
		break
	cant += 1
j = cant
for i in range(n - 1, 0, -1):
	if i == j - 1:
		break
	if numbers[i] > k:
		break
	cant += 1
print(cant)


def go():
	(n, k) = (int(i) for i in input().split(' '))
	a = [int(i) for i in input().split(' ')]
	t = 0
	i = 0
	while i < n and a[i] <= k:
		i += 1
		t += 1
	if i == n:
		return t
	a = a[::-1]
	i = 0
	while a[i] <= k:
		i += 1
		t += 1
	return t
print(go())


import sys
input = sys.stdin.readline
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
l = 0
while l < n:
	if a[l] > k:
		break
	l += 1
r = n - 1
while l < r:
	if a[r] > k:
		break
	r -= 1
print(l + (n - r - 1))


nk = list(map(int, input().rstrip().split(' ')))
n = nk[0]
k = nk[1]
array = list(map(int, input().rstrip().split(' ')))
ar_len = len(array)
min = -1
max = ar_len
for i in range(ar_len):
	if array[i] > k:
		min = i
		break
for i in range(ar_len - 1, -1, -1):
	if array[i] > k:
		max = i
		break
can_play = n - (max - min + 1)
if can_play < 0:
	print(n)
else:
	print(can_play)


def solve(lst, k):
	max = 0
	temp = 0
	for i in range(len(lst)):
		if lst[i] <= k:
			max += 1
			temp = i
		else:
			temp = i
			break
	i = len(lst) - 1
	while i > temp:
		if lst[i] <= k:
			max += 1
			i -= 1
		else:
			break
	return max
(n, k) = map(int, input().split())
lst = list(map(int, input().split()))
print(solve(lst, k))


(n, k) = map(int, input().split())
a = [i for i in map(int, input().split())]
ans = 0
for i in a[::-1]:
	if i > k:
		break
	else:
		ans += 1
for i in a:
	if i > k:
		break
	else:
		ans += 1
print(ans if ans <= n else n)


import sys
input = sys.stdin.readline
from collections import *
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
if max(a) <= k:
	print(n)
	exit()
ans = 0
for i in range(n):
	if a[i] <= k:
		ans += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		ans += 1
	else:
		break
print(ans)


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
(n, m) = q()
a = list(q())
(x, y) = (0, 0)
for i in range(n):
	if a[i] > m:
		x = i
		break
for i in a[::-1]:
	if i > m:
		y = len(a) - a[::-1].index(i)
		break
print(len(a) - (y - x))


(n, k) = [int(i) for i in input().split()]
num = [int(i) for i in input().split()]
i = 0
j = n - 1
res = 0
while i < n and num[i] <= k:
	res += 1
	i += 1
while i <= j and num[j] <= k:
	res += 1
	j -= 1
print(res)


def main():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	left = 0
	ans = 0
	while left < n and a[left] <= k:
		left += 1
		ans += 1
	right = n - 1
	while right >= 0 and a[right] <= k:
		right -= 1
		ans += 1
	print(min(ans, n))
main()


(n, k) = map(int, input().split())
data = [int(x) for x in input().split()]
l = 0
otvet = 0
for x in data:
	if x <= k:
		otvet += 1
		l += 1
	else:
		break
if n != l:
	for x in range(n):
		n -= 1
		if data[n] <= k:
			otvet += 1
		else:
			break
print(otvet)


inp = input().rstrip().split(' ')
n = int(inp[0])
k = int(inp[1])
cnt = 0
if n >= 1 and n <= 100 and (k >= 1) and (k <= 100):
	diff = [int(x) for x in input().rstrip().split(' ') if int(x) >= 1 and int(x) <= 100]
	flag = 0
	for i in diff:
		if i <= k:
			cnt = cnt + 1
		else:
			flag = 1
			break
	if flag == 1 and cnt < len(diff):
		diff2 = diff[::-1]
		for i in diff2:
			if i <= k:
				cnt = cnt + 1
			else:
				break
print(cnt)


import sys
input = sys.stdin.readline
(n, k) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
for i in range(n):
	if l[i] <= k:
		c += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if l[i] <= k:
		c += 1
	else:
		break
print(min(n, c))


(n, k) = map(int, input().split())
dq = [int(x) for x in input().split()]
count = 0
count = 0
flag = True
for i in range(n):
	if dq[i] <= k:
		count += 1
	else:
		flag = False
		break
dq.reverse()
if flag is False:
	for i in range(n):
		if dq[i] <= k:
			count += 1
		else:
			break
print(count)


def inp():
	return map(int, input().split())

def arr_inp():
	return [int(x) for x in input().split()]
(n, k) = inp()
a = arr_inp()
out = 0
for i in a:
	if i <= k:
		out += 1
	else:
		break
if out < n:
	for i in range(n - 1, out, -1):
		if a[i] <= k:
			out += 1
		else:
			break
print(out)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
x = 0
for i in l:
	if i <= k:
		x += 1
	else:
		break
l.reverse()
for i in l:
	if i <= k:
		x += 1
	else:
		break
if x > len(l):
	print(len(l))
else:
	print(x)


inp = str(input())
pnum = int(inp.split(' ')[0])
skill = int(inp.split(' ')[1])
inp = str(input())
diff = inp.split(' ')
diff = [int(x) for x in diff]
c = 0
while len(diff) > 0:
	if diff[0] <= skill:
		diff.pop(0)
		c += 1
	elif diff[len(diff) - 1] <= skill:
		diff.pop()
		c += 1
	else:
		break
print(c)


(m, k) = map(int, input().split())
d = list(map(int, input().split()))
p = 0
count = 0
while p < len(d):
	if d[p] > k:
		break
	count += 1
	p += 1
c = 0
p = len(d) - p
while c < p:
	if d[-1 - c] > k:
		break
	count += 1
	c += 1
print(count)


(a, b) = map(int, input().split())
k = list(map(int, input().split()))
m = 0
n = 0
for i in k:
	if i <= b:
		m += 1
	else:
		break
k = k[::-1]
for j in k:
	if j <= b:
		n += 1
	else:
		break
if m + n >= len(k):
	print(len(k))
else:
	print(m + n)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
m = []
for i in range(n):
	if a[i] > k:
		m.append(i)
if len(m) == 0:
	print(n)
else:
	print(n - (m[-1] - m[0] + 1))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
pos = 0
while pos < n and a[pos] <= k:
	count += 1
	pos += 1
pos = n - 1
if count != n:
	while pos >= 0 and a[pos] <= k:
		count += 1
		pos -= 1
print(count)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for el in a:
	if el > k:
		break
	cnt += 1
for el in a[::-1]:
	if el > k:
		break
	cnt += 1
print(min(cnt, n))


(n, k) = [int(c) for c in input().split()]
pd = [int(c) for c in input().split()]
(i, j) = (0, n - 1)
ans = 0
while i <= j:
	if pd[i] <= k:
		i += 1
		ans += 1
	elif pd[j] <= k:
		j -= 1
		ans += 1
	else:
		break
print(ans)


(a, k) = input().split()
ar = list(map(int, input().rstrip().split()))
counter = 0
for i in range(int(a)):
	if ar[0] <= int(k):
		ar.pop(0)
		counter += 1
	elif ar[len(ar) - 1] <= int(k):
		ar.pop(len(ar) - 1)
		counter += 1
	else:
		break
print(counter)


def solving_tests():
	cases = input().split()
	tests = input().split()
	cases = [int(i) for i in cases]
	output = 0
	while True:
		if len(tests) > 0:
			if cases[1] >= int(tests[0]):
				output += 1
				tests.pop(0)
			elif cases[1] >= int(tests[-1]):
				output += 1
				tests.pop()
			else:
				print(output)
				return
		else:
			break
	print(output)
	return
solving_tests()


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
res = []
c = 0
i = 0
while i < len(a):
	if a[i] <= k:
		c += 1
		a.pop(i)
		i = 0
	elif a[len(a) - 1 - i] <= k:
		c += 1
		a.pop(len(a) - 1)
		i = 0
	else:
		break
print(c)


(n, k) = map(int, input().split())
A = list(map(int, input().split(' ')[:n]))
temp = 0
for i in range(n):
	if A[i] <= k:
		temp += 1
		A[i] += k
	else:
		break
A.reverse()
for i in A:
	if i <= k:
		temp += 1
	else:
		print(temp)
		exit()
print(temp)


(n, k) = map(int, input().split())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
i = 0
l = 0
while i < n and a[i] <= k:
	l += 1
	i += 1
i = n - 1
while i >= 0 and a[i] <= k:
	l += 1
	i -= 1
if l // 2 == n:
	print(n)
else:
	print(l)


TN = 1

def solution():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	i1 = 0
	i2 = 0
	for i in range(n):
		if a[i] <= k:
			i1 += 1
		else:
			break
	else:
		i2 = -n
	for i in reversed(range(n)):
		if a[i] <= k:
			i2 += 1
		else:
			break
	print(i1 + i2)
while TN != 0:
	solution()
	TN -= 1


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
(x, y) = (0, n - 1)
t = 0
for i in range(n):
	if a[x] <= k:
		t += 1
		x += 1
	elif a[y] <= k:
		t += 1
		y -= 1
	else:
		break
print(t)


inp = [int(x) for x in input().split()]
n = inp[0]
k = inp[1]
zad = [int(x) for x in input().split()]
counter = 0
for x in zad:
	if x > k:
		break
	else:
		counter += 1
if counter == len(zad):
	print(counter)
	exit(0)
for x in range(len(zad) - 1, -1, -1):
	if zad[x] > k:
		break
	else:
		counter += 1
print(counter)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
while a and a[0] <= k:
	a.pop(0)
	ans += 1
a.reverse()
while a and a[0] <= k:
	a.pop(0)
	ans += 1
print(ans)


nk = input().split(' ')
problems = input().split(' ')
count = 0
for i in range(len(problems)):
	if int(nk[1]) >= int(problems[0]):
		problems.pop(0)
		count += 1
	elif int(nk[1]) >= int(problems[-1]):
		problems.pop()
		count += 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
mas = list(map(int, input().split()))
f = 0
for i in range(n):
	if mas[i] > k:
		break
	else:
		f += 1
mas = mas[f:]
mas.reverse()
for i in range(n - f):
	if mas[i] > k:
		break
	else:
		f += 1
print(f)


(n, k) = map(int, input().split(' '))
aa = list(map(int, input().split(' ')))
m = max(aa)
if m <= k:
	print(len(aa))
else:
	res = 0
	for a in aa:
		if a > k:
			break
		res += 1
	for a in aa[::-1]:
		if a > k:
			break
		res += 1
	print(res)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
(l, r) = (-1, -1)
for i in range(n):
	if a[i] > k:
		l = i
		break
for j in range(n - 1, -1, -1):
	if a[j] > k:
		r = j
		break
if l == -1:
	print(n)
else:
	print(n - r + l - 1)


N = input().split()
A = int(N[1])
B = int(N[0])
arr = input().split()
ans = 0
p = 0
for i in range(B):
	if int(arr[i]) <= A:
		ans += 1
	else:
		p = 1
		break
for j in range(B - 1, -1, -1):
	if int(arr[j]) <= A:
		ans += 1
	else:
		p = 1
		break
if p == 0:
	print(int(ans // 2))
else:
	print(ans)


import sys
(N, K) = map(int, sys.stdin.readline().split())
a = [int(x) for x in input().split()]

def foo(arr):
	if not arr:
		return 0
	elif arr[0] <= K:
		arr.pop(0)
		return foo(arr) + 1
	elif arr[len(arr) - 1] <= K:
		arr.pop(len(arr) - 1)
		return foo(arr) + 1
	else:
		return 0
print(foo(a))


import collections
(n, k) = map(int, input().split())
a = collections.deque(map(int, input().split()))
f = 0
count = 0
fl1 = True
fl2 = True
while True:
	if f == 0 and fl1 == True:
		if a[0] <= k:
			count += 1
			a.popleft()
		else:
			fl1 = False
	elif f == 1 and fl2 == True:
		if a[-1] <= k:
			count += 1
			a.pop()
		else:
			fl2 = False
	if f == 0:
		f = 1
	else:
		f = 0
	if fl1 == False and fl2 == False:
		break
	if len(a) == 0:
		break
print(count)


(n, k) = map(int, input().split())
prob = list(map(int, input().split()))
count = 0
while len(prob) > 0:
	first = prob[0]
	last = prob[-1]
	if k >= first:
		prob.pop(0)
		count += 1
	elif k >= last:
		prob.pop(-1)
		count += 1
	else:
		break
print(count)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
cnt = 0
while True:
	if len(a) == 0:
		break
	if a[0] <= k:
		cnt += 1
		a = a[1:]
		continue
	elif a[-1] <= k:
		cnt += 1
		a = a[:-1]
		continue
	else:
		break
print(cnt)


def read_input():
	return list(map(int, input().split()))
inputs = read_input()
problems_input = read_input()
n = inputs[0]
k = inputs[1]
problems = problems_input
solved = 0

def solve_side(k, problems, right=False):
	solved_problems = 0
	if right:
		problems.reverse()
	while len(problems) > 0:
		if problems[0] <= k:
			problems.remove(problems[0])
			solved_problems += 1
		else:
			break
	return solved_problems
solved += solve_side(k, problems)
solved += solve_side(k, problems, right=True)
print(solved)


(n, k, count) = (0, 0, 0)
flag = True
inp = [int(i) for i in input().split()]
n = inp[0]
k = inp[1]
inp = [int(i) for i in input().split()]
lst = []
for i in range(0, n):
	l = inp[i]
	if flag and l <= k:
		count += 1
	else:
		flag = False
		lst.append(l)
for i in range(0, len(lst)):
	if lst[len(lst) - i - 1] > k:
		break
	else:
		count += 1
print(count)


A = input().split(' ')
b = [int(num) for num in A]
(n, k) = (b[0], b[1])
B = input().split(' ')
a = [int(num) for num in B]
count = 0
l = len(a)
i = 0
j = l - 1
while i >= 0 and i < n and (j >= 0) and (j < n) and (i != j):
	if a[i] > k and a[j] > k:
		break
	if a[i] <= k:
		count += 1
		i += 1
	elif a[j] <= k:
		count += 1
		j -= 1
if i == j:
	if a[i] <= k:
		count += 1
print(count)


(n, k) = input().split()
k = int(k)
L = [int(x) for x in input().split()]
count = 0
for i in range(int(n)):
	if L[0] <= k:
		L.pop(0)
		count = count + 1
	elif L[-1] <= k:
		L.pop()
		count = count + 1
	else:
		break
print(count)


string = input().split(' ')
n = int(string[0])
k = int(string[1])
problems = input().split(' ')
while True:
	if len(problems) != 0:
		if int(problems[0]) <= k:
			problems.pop(0)
		else:
			break
	else:
		break
while True:
	if len(problems) != 0:
		if int(problems[len(problems) - 1]) <= k:
			problems.pop()
		else:
			break
	else:
		break
print(str(n - len(problems)))


(n, k) = list(map(int, input().split(' ')))
a_list = list(map(int, input().split(' ')))
(i, j) = (0, len(a_list) - 1)
count = 0
while i <= j:
	if a_list[i] <= k:
		count += 1
		i += 1
	elif a_list[j] <= k:
		count += 1
		j -= 1
	else:
		break
print(count)


def problem_checker(n, k, problems):
	start = 0
	end = n
	result = 0
	if problems[start] > k and problems[end] > k:
		return result
	elif k == 100:
		return len(problems)
	else:
		while start != end + 1:
			if problems[start] <= k:
				result += 1
				start += 1
			elif problems[end] <= k:
				result += 1
				end -= 1
			else:
				break
	return result
nk = list(map(int, input().split()))
problems = list(map(int, input().split()))
print(problem_checker(nk[0] - 1, nk[1], problems))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
l = len(a)
while i < l and a[i] <= k:
	i += 1
j = 0
while j < l - 1 and i < l - j - 1 and (a[l - j - 1] <= k):
	j += 1
print(i + j)


import itertools
import sys

def i_ints():
	return map(int, sys.stdin.readline().split())
(n, k) = i_ints()
a = i_ints()
a = itertools.dropwhile(k.__ge__, a)
a = itertools.dropwhile(k.__ge__, reversed(list(a)))
print(n - len(list(a)))


def solve(data):
	(n, k) = map(int, data[0].split())
	arr = list(map(int, data[1].split()))
	c = 0
	for i in range(n):
		if arr[i] > k:
			break
		c += 1
	if c == n:
		return c
	for j in range(n - 1, i - 1, -1):
		if arr[j] > k:
			break
		c += 1
	return c
data = []
data.append(input().strip())
data.append(input().strip())
res = solve(data)
print(res)


(n, m) = map(int, input().split())
difficult = list(map(int, input().split()))
calc = 0
d = 0
for k in range(n):
	d = k
	if m >= difficult[k]:
		calc += 1
	else:
		break
if d != n - 1:
	for z in range(n - 1, -1, -1):
		if m >= difficult[z]:
			calc += 1
		else:
			break
print(calc)


a = input()
(n, k) = list(map(int, a.split()))
b = input()
t = 0
p = 0
s = 0
r = 0
b1 = list(map(int, b.split()))
for i in range(len(b1)):
	if b1[i] > k:
		t = i
		r = 1
		break
b1.reverse()
for i in range(len(b1)):
	if b1[i] > k:
		p = i
		s = 1
		break
if s == 0 and r == 0:
	print(len(b1))
else:
	print(t + p)


line1 = list(map(int, input().strip().split()))
problems = list(map(int, input().strip().split()))
n = line1[0]
k = line1[1]
j = n - 1
answered = 0
happened = True
while happened and len(problems) > 0:
	happened = False
	if problems[0] <= k:
		del problems[0]
		j -= 1
		answered += 1
		happened = True
	if len(problems) > 0 and problems[j] <= k:
		del problems[j]
		j -= 1
		answered += 1
		happened = True
print(answered)


(N, K) = map(int, input().split())
L = list(map(int, input().split()))
count = 0
if max(L) <= K:
	print(len(L))
else:
	while L[0] <= K:
		L.pop(0)
		count += 1
	if L:
		while L[-1] <= K:
			L.pop()
			count += 1
	print(count)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_int = lambda : int(sys.stdin.readline().strip())
pt = lambda x: sys.stdout.write(str(x))
(n, k) = get_list()
problem = get_list()
first = last = -1
for i in range(n):
	if problem[i] > k:
		first = i
		break
for j in range(n - 1, -1, -1):
	if problem[j] > k:
		last = j
		break
if first == -1 or last == -1:
	print(n)
else:
	unsolved = last - first + 1
	print(n - unsolved)


s = input().split(' ')
n = int(s[0])
k = int(s[1])
s = input().split(' ')
arr = [int(s[i]) for i in range(n)]
res = 0
for i in range(n):
	if arr[i] <= k:
		res += 1
	else:
		break
if res == n:
	print(n)
else:
	for i in range(n):
		if arr[-i - 1] <= k:
			res += 1
		else:
			break
	print(res)


(_, k) = map(int, input().split())
lst = list(map(int, input().split()))
c = 0
while len(lst) > 0 and (lst[0] <= k or lst[-1] <= k):
	if lst[0] <= k:
		lst = lst[1:]
		c += 1
	elif lst[-1] <= k:
		lst = lst[:-1]
		c += 1
	else:
		break
print(c)


(n, k) = input().split()
n = int(n)
k = int(k)
a = [int(k) for k in input().split()]
count = 0
i = 0
while i < len(a) and a[i] <= k:
	count += 1
	i += 1
j = len(a) - 1
while j >= i and a[j] <= k:
	count += 1
	j -= 1
print(count)


(n, k) = map(int, input().split())
import collections
dat = collections.deque(list(map(int, input().split())))
while True:
	if len(dat) == 0:
		break
	p = dat.popleft()
	if p <= k:
		continue
	else:
		dat.appendleft(p)
	if len(dat) == 0:
		break
	p = dat.pop()
	if p <= k:
		continue
	else:
		dat.append(p)
	break
print(n - len(dat))


(a, c) = map(int, input().split())
b = list(map(int, input().split()))
n = 0
for i in range(a):
	if b[0] <= c:
		b.pop(0)
		a -= 1
	elif b[a - 1] <= c:
		b.pop(a - 1)
		a -= 1
	else:
		break
	n += 1
print(n)


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
d = list(reversed(c))
x = y = k = int(0)
while x < a:
	if c[x] <= b:
		k = k + 1
	else:
		break
	x = x + 1
if k != a:
	while y < a:
		if d[y] <= b:
			k = k + 1
		else:
			break
		y = y + 1
print(k)


(n, k) = [int(x) for x in input().strip().split(' ')]
l = [int(x) for x in input().strip().split(' ')]
c = 0
while l != []:
	if l[0] <= k:
		c += 1
		l.pop(0)
	elif l[len(l) - 1] <= k:
		c += 1
		l.pop(len(l) - 1)
	else:
		break
print(c)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
i = 0
while i < n and a[i] <= k:
	i += 1
s = i
if i != n:
	i = n - 1
	while i >= 0 and a[i] <= k:
		i -= 1
	s += n - i - 1
print(s)


(n, k) = map(int, input().split())
L = list(map(int, input().split()))
s = 0
while True:
	if len(L) == 0:
		print(s)
		break
	if L[0] <= k:
		s += 1
		del L[0]
	elif L[-1] <= k:
		s += 1
		del L[-1]
	else:
		print(s)
		break


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
count = 0
add = 0
for i in range(a):
	if l[i] <= b:
		count += 1
	else:
		break
l.reverse()
for i in range(a):
	if l[i] <= b:
		add += 1
	else:
		break
if count == a:
	print(count)
else:
	print(count + add)


str = list(map(int, input().split(' ')))
n = str[0]
k = str[1]
lt = []
sum = 0
lt = list(map(int, input().split(' ')))
y = 1
while n is not 0:
	if lt[0] <= k:
		sum = sum + 1
		del lt[0]
		n = n - 1
	elif lt[-1] <= k:
		sum = sum + 1
		del lt[-1]
		n = n - 1
	else:
		break
print(sum)


o = input().rstrip().split(' ')
p = input().rstrip().split(' ')
k = int(o[1])
S = 0
for i in range(0, len(p)):
	if int(p[i]) <= k:
		S += 1
	else:
		break
if S == int(o[0]):
	print(S)
else:
	for i in range(len(p) - 1, -1, -1):
		if int(p[i]) <= k:
			S += 1
		else:
			break
	print(S)


(n, k) = map(int, input().split())
problem = list(map(int, input().split()))
left = 0
right = n - 1
count = 0
while True:
	if problem[left] <= k and left <= right:
		count += 1
		left += 1
	elif problem[right] <= k and left <= right:
		count += 1
		right -= 1
	else:
		break
	if left > right:
		break
print(count)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
(c1, i, j) = (0, 0, n - 1)
while i < n:
	if l[i] <= k:
		c1 += 1
		i += 1
	elif l[j] <= k:
		c1 += 1
		j -= 1
	else:
		break
print(c1)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
j = len(a) - 1
count = 0
while True:
	if j != -1 and a[i] <= k:
		a.pop(i)
		count += 1
		j -= 1
	elif j != -1 and a[j] <= k:
		a.pop(j)
		count += 1
		j -= 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
(l, r) = (0, n - 1)
while l <= r:
	if a[l] <= k or a[r] <= k:
		count += 1
		if a[l] <= k:
			l += 1
		elif a[r] <= k:
			r -= 1
	else:
		break
print(count)


def solve(a, k):
	c = 0
	i = 0
	j = len(a) - 1
	while j >= i:
		if a[i] > k and a[j] > k:
			print(c)
			return
		elif a[i] <= a[j] and a[i] <= k:
			c += 1
			i += 1
		elif a[j] <= a[i] and a[j] <= k:
			c += 1
			j -= 1
		else:
			i += 1
			j -= 1
	print(c)
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
solve(a, k)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
j = -1
flag = 0
c = 0
while flag == 0 and i <= len(a) + j:
	if a[i] <= k:
		c += 1
		i += 1
		continue
	if a[j] <= k:
		c += 1
		j -= 1
		continue
	else:
		flag = 1
print(c)


(n, k) = map(int, input().split())
mass = list(map(int, input().split()))
x = 0
for i in range(n):
	if mass[i] <= k:
		x += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if mass[i] <= k:
		x += 1
	else:
		break
print(min(x, n))


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
while 1:
	if len(l) == 0:
		break
	if l[0] <= k:
		l.pop(0)
		ans += 1
	elif l[len(l) - 1] <= k:
		l.pop(len(l) - 1)
		ans += 1
	else:
		break
print(ans)


import sys
import collections

def readArray(type=int):
	line = input()
	return [type(x) for x in line.split()]

def solve():
	(n, k) = readArray()
	ar = readArray()
	cb = ca = 0
	i = 0
	while i < n:
		if ar[i] > k:
			break
		i += 1
		ca += 1
	i = n - 1
	while i >= 0:
		if ar[i] > k:
			break
		i -= 1
		cb += 1
	print(ca + cb if ca + cb < n else n)
solve()


(n, k) = map(int, input().split())
arr = [int(x) for x in input().split()]
count = 0
while len(arr) != 0:
	if arr[0] <= k:
		count += 1
		arr.remove(arr[0])
	else:
		break
for i in range(len(arr) - 1, -1, -1):
	if arr[i] <= k:
		count += 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
cnt = 0
p = n
for i in range(p):
	fg = 0
	if l[0] <= k:
		cnt += 1
		l = l[1:]
		n -= 1
		fg += 1
	if l != [] and l[n - 1] <= k:
		cnt += 1
		l = l[0:n - 1]
		n -= 1
		fg += 1
	if fg == 0 or l == []:
		break
print(cnt)


(n, k) = [int(ele) for ele in str(input()).split()]
dif = [1] + [int(ele) for ele in str(input()).split()]
solNum = 0
leftPos = 0
rightPos = n
for idx in range(1, n + 1, 1):
	if dif[idx] > k:
		break
	solNum = solNum + 1
	leftPos = leftPos + 1
for idx in range(n, 0, -1):
	if dif[idx] > k or rightPos <= leftPos:
		break
	solNum = solNum + 1
	rightPos = rightPos - 1
print(solNum)


(n, m) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
l = 0
r = n - 1
c = 0
while l <= r:
	if l == r:
		if a[l] <= m:
			c += 1
			break
		else:
			break
	else:
		if a[l] <= m:
			l += 1
			c += 1
		if a[r] <= m:
			r -= 1
			c += 1
		if a[l] > m and a[r] > m:
			break
print(c)


(n, k) = map(int, input().split())
nums = []
c = 0
listInputs = input().split(' ')
for i in range(len(listInputs)):
	if len(listInputs) >= 1 and int(listInputs[-1]) <= k:
		listInputs.pop(-1)
		c += 1
	if len(listInputs) >= 1 and int(listInputs[0]) <= k:
		listInputs.pop(0)
		c += 1
print(c)


(n, k) = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
i = 0
j = n - 1
c = 0
while i < n and l[i] <= k:
	c += 1
	i += 1
while j > i and l[j] <= k:
	c += 1
	j -= 1
print(c)


a = input()
b = input()
s = 0
L1 = a.split()
L2 = b.split()
for i in range(2):
	L1[i] = int(L1[i])
for i in range(len(L2)):
	L2[i] = int(L2[i])
for i in range(len(L2)):
	if L2[i] <= L1[1]:
		s = s + 1
	else:
		break
if s != len(L2):
	L2.reverse()
	for i in range(len(L2)):
		if L2[i] <= L1[1]:
			s = s + 1
		else:
			break
print(s)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [Scanner.string() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [Scanner.int() for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def solve():
	(N, K) = Scanner.map_int()
	A = Scanner.map_int()
	l = N
	for i in range(N):
		if A[i] > K:
			l = i
			break
	r = 0
	for i in reversed(range(N)):
		if A[i] > K:
			r = N - 1 - i
			break
	print(l + r)

def main():
	solve()
main()


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = n - 1
while len(a) > 0 and (a[0] <= k or a[i] <= k):
	if a[0] <= k:
		a.remove(a[0])
		i -= 1
	if i < 0:
		break
	if a[i] <= k:
		a.pop(i)
		i -= 1
print(n - len(a))


(nb, skill) = map(int, input('').split(' '))
problems = input('').split(' ')
for i in range(len(problems)):
	problems[i] = int(problems[i])
indicateur = True
result = 0
while indicateur and problems != []:
	if problems[0] <= skill:
		del problems[0]
		result += 1
	else:
		indicateur = not indicateur
while not indicateur and problems != []:
	if problems[-1] <= skill:
		del problems[-1]
		result += 1
	else:
		indicateur = not indicateur
print(result)


(x, y) = map(int, input().split())
a = list(map(int, input().split()))
k = 0
t = 0
z = [0] * 2
if x == 1 and y >= a[0]:
	print(1)
elif y < a[0] and len(a) == 1:
	print('0')
else:
	for i in range(1, len(a) + 1):
		if k == 1 and t == 1:
			break
		if a[i - 1] > y and k == 0:
			z[0] = i
			k = k + 1
		if a[len(a) - i] > y and t == 0:
			z[1] = len(a) - i + 1
			t = t + 1
		if k == 1 and t == 1:
			break
	if z[0] != 0 or z[1] != 0:
		print(len(a) - z[1] + z[0] - 1)
	else:
		print(len(a))


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 0
	for i in range(n):
		if a[i] > k:
			break
		ans += 1
	for i in range(n - 1, -1, -1):
		if a[i] > k:
			break
		ans += 1
	print(min(ans, n))
main()


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
i = j = k = c = 0
d = 0
while len(l) != 0 and d != 1:
	if i % 2 == 0:
		if l[0] <= m:
			c += 1
		else:
			j = 1
			i -= 1
		l = l[1:]
	else:
		if l[-1] <= m:
			c += 1
		else:
			k = 1
			i -= 1
		l = l[:-1]
	if j == 1 and k == 1:
		d = 1
	elif j == 1 or k == 1:
		i += 2
	else:
		i += 1
print(c)


(n, k) = map(int, input().split())
p = list(map(int, input().split()))
c = 0
while len(p) > 0 and p[0] <= k:
	c += 1
	p.pop(0)
i = len(p) - 1
while i >= 0 and p[i] <= k:
	c += 1
	i -= 1
print(c)


def lower_from_edge_count(k, array):
	count = 0
	i = 0
	j = len(array) - 1
	while i < len(array) and array[i] <= k:
		i += 1
		count += 1
	if i == len(array):
		return count
	while j > 0 and array[j] <= k:
		j -= 1
		count += 1
	return count
(n, k) = map(int, input().split())
array = list(map(int, input().split()))
print(lower_from_edge_count(k, array))


(n, k) = map(int, input().split())
s = list(map(int, input().split()))
z = n
while n != 0 and s[0] <= k:
	s.pop(0)
	n -= 1
while n != 0 and s[n - 1] <= k:
	s.pop()
	n -= 1
print(z - n)


(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
l = min((i for (i, x) in enumerate(a) if x > k), default=None)
if l is None:
	print(n)
	exit()
r = max((i for (i, x) in enumerate(a) if x > k))
print(l + n - r - 1)


(n, k) = map(int, input().split())
M = list(map(int, input().split()))
c = 0
for i in range(n):
	if M[i] < k or M[i] == k:
		c += 1
	else:
		break
for j in range(n - 1, -1, -1):
	if M[j] < k or M[j] == k:
		c += 1
	else:
		break
if c == 2 * n:
	print(n)
else:
	print(c)


nk = [int(i) for i in input().strip().split()]
(n, k) = (nk[0], nk[1])
a = [int(i) for i in input().strip().split()]
count = 0
i = 0
while i < n:
	if a[i] <= k:
		count += 1
		i += 1
	else:
		break
if i == n:
	print(count)
else:
	j = n - 1
	while j > i:
		if a[j] <= k:
			count += 1
			j -= 1
		else:
			break
	print(count)


(a, b) = map(int, input().split())
d = 0
c = list(map(int, input().split()))
if max(c) <= b:
	print(len(c))
else:
	while c[0] <= b or c[len(c) - 1] <= b:
		if c[0] <= b:
			c.pop(0)
		elif c[len(c) - 1] <= b:
			c.pop(len(c) - 1)
		d += 1
	print(d)


arr = [int(x) for x in input().split()]
(n, k) = (arr[0], arr[1])
a = [int(x) for x in input().split()]
(count, lf, rf) = (0, 1, 1)
while lf and len(a):
	if a[0] <= k:
		count += 1
		del a[0]
	else:
		lf = 0
while rf and len(a):
	if a[-1] <= k:
		count += 1
		del a[-1]
	else:
		rf = 0
print(count)


(n, k) = [int(i) for i in input().split()]
v = [int(i) for i in input().split()]
flag1 = 0
flag2 = 0
for i in range(n):
	if v[i] <= k:
		flag1 += 1
	else:
		break
if flag1 != n:
	for i in range(n):
		if v[n - 1 - i] <= k:
			flag1 += 1
		else:
			break
print(flag1)


def func(ki, kl):
	h1 = 0
	h2 = 0
	for i in range(len(kl)):
		if kl[i] > ki:
			h1 = i
			break
		if i == len(kl) - 1:
			return len(kl)
	for i in range(len(kl) - 1, -1, -1):
		if kl[i] > ki:
			h2 = len(kl) - i - 1
			break
	return h1 + h2
count = input().split()
for i in range(len(count)):
	count[i] = int(count[i])
li = input().split()
for i in range(len(li)):
	li[i] = int(li[i])
k = count[1]
rez = func(k, li)
print(rez)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
a = []
for x in range(n):
	if l[x] > k:
		a.append(x)
if a == []:
	print(n)
else:
	print(a[0] + (n - a[-1] - 1))


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
(x, y) = (0, n - 1)
c = 0
while x <= y:
	if a[x] > k and a[y] > k:
		break
	elif a[x] > k:
		y -= 1
	else:
		x += 1
	c += 1
print(c)


line1 = input().split()
line2 = input().split()
l = [int(j) for j in line2]
line1 = [int(i) for i in line1]
n = line1[0]
k = line1[1]

def cheak_endes(l, k):
	if len(l) == 0:
		return 'no'
	elif l[0] > k and l[-1] > k:
		return 'no'

def forward(li, k):
	delated = []
	for i in li:
		if i <= k:
			delated.append(i)
		else:
			break
	for j in delated:
		li.remove(j)
	return li

def backward(li, k):
	delated = []
	for i in reversed(li):
		if i <= k:
			delated.append(i)
		else:
			break
	for j in delated:
		li.remove(j)
	return li

def calc_num_of_tasks_can_be_solved(l, k):
	if cheak_endes(l, k) == 'no':
		return 0
	l = forward(l, k)
	if cheak_endes(l, k) == 'no':
		return n - len(l)
	l = backward(l, k)
	if cheak_endes(l, k) == 'no':
		return n - len(l)
	return n - len(l)
x = calc_num_of_tasks_can_be_solved(l, k)
print(x)


(l, m) = input().split()
string = input()
string = string.split()
flag = True
temp = None
for (index, s) in enumerate(string):
	if int(m) < int(s):
		temp = string[index:]
		break
	if index + 1 == len(string):
		flag = False
		print(l)
if temp != None:
	temp = list(reversed(temp))
	temp2 = list
	for (index, s) in enumerate(temp):
		if int(m) < int(s):
			temp2 = temp[index:]
			break
	if flag == True:
		print(int(l) - len(temp2))


s = input()
s = list(map(int, s.split()))
l = input()
l = list(map(int, l.split()))
n = 0
t = 1
while t == 1 and len(l) != 0:
	if l[0] > s[1]:
		if l[s[0] - 1] > s[1]:
			t = 0
		else:
			n += 1
			del l[s[0] - 1]
			s[0] -= 1
	else:
		n += 1
		del l[0]
		s[0] -= 1
print(n)


m = input()
n = list(map(int, m.split(' ')))
arr = input()
l = list(map(int, arr.split(' ')))
i = 0
c = 0
while i < n[0]:
	if l[i] > n[1]:
		break
	i += 1
	c += 1
m1 = -1
while True and i != n[0]:
	if l[m1] > n[1]:
		break
	m1 -= 1
	c += 1
print(c)


(n, k) = input().split()
n = int(n)
k = int(k)
cnt = 0
l = list(map(int, input().split()))
for i in l:
	if i <= k:
		cnt += 1
	else:
		break
for i in range(cnt):
	l.pop(0)
for i in reversed(l):
	if i <= k:
		cnt += 1
	else:
		break
print(cnt)


from collections import Counter
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys
from collections import Counter
(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
i = 0
j = n - 1
if max(arr) <= k:
	print(n)
	exit()
while i <= j:
	if arr[i] <= k:
		i += 1
	if arr[j] <= k:
		j -= 1
	if arr[i] > k and arr[j] > k:
		break
print(i + n - 1 - j)


def answer():
	a = [int(x) for x in input().split()]
	k = a[1]
	n = [int(x) for x in input().split()]
	ans = 0
	while n:
		if k >= n[0]:
			ans += 1
			n = n[1:]
		elif k >= n[-1]:
			ans += 1
			n = n[:-1]
		else:
			break
	print(ans)
answer()


class CodeforcesTask999ASolution:

	def __init__(self):
		self.result = ''
		self.n_k = []
		self.problems = []

	def read_input(self):
		self.n_k = [int(x) for x in input().split(' ')]
		self.problems = [int(x) for x in input().split(' ')]

	def process_task(self):
		left = 0
		right = 0
		for x in range(len(self.problems)):
			if self.n_k[1] >= self.problems[x]:
				left += 1
			else:
				break
		for x in range(len(self.problems)):
			if self.n_k[1] >= self.problems[len(self.problems) - x - 1]:
				right += 1
			else:
				break
		if left + right > len(self.problems):
			result = len(self.problems)
		else:
			result = left + right
		self.result = str(result)

	def get_result(self):
		return self.result
Solution = CodeforcesTask999ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


from sys import stdin, stdout

def main():
	(line1, line2) = [x for x in stdin.readlines()]
	(number_of_problems, skill) = [int(x) for x in line1.split()]
	problems = [int(x) for x in line2.split()]
	alist = []
	result = len(problems)
	for (index, element) in enumerate(problems):
		if element > skill:
			alist.append(index)
	if len(alist) == 1:
		result = len(problems) - 1
	if len(alist) > 1:
		result = len(problems) - (alist[-1] - alist[0] + 1)
	print(result)
	return result
main()


(n, k) = tuple(map(lambda x: int(x), input().split()))
probs = list(map(lambda x: int(x), input().split()))
count = 0
i = 0
while i < len(probs) and probs[i] <= k:
	count += 1
	i += 1
j = len(probs) - 1
while j > i and probs[j] <= k:
	count += 1
	j -= 1
print(count)


s = input().split()
n = int(s[0])
k = int(s[1])
l = list(map(int, input().split()))
cnt = 0
while len(l) > 0 and l[0] <= k:
	cnt += 1
	l.pop(0)
while len(l) > 0 and l[len(l) - 1] <= k:
	cnt += 1
	l.pop()
print(cnt)


(n, k) = [int(i) for i in input().split()]
h = 0
g = 0
a = [int(i) for i in input().split()]
for i in range(0, n):
	c = i
	if a[c] <= k:
		h = h + 1
	else:
		break
for i in range(n, 0, -1):
	b = i - 1
	if a[b] <= k:
		g = g + 1
	else:
		break
s = int(g + h)
if s <= n:
	print(int(s))
else:
	print(int(s / 2))


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
r = l[::-1]
left = 0
LEFT = True
RIGHT = True
right = 0
for i in range(len(l)):
	s = left + right
	if l[i] <= k and LEFT and (s != len(l)):
		left += 1
	else:
		LEFT = False
	if r[i] <= k and RIGHT and (s != len(l)):
		right += 1
	else:
		RIGHT = False
	if left + right >= len(l):
		break
ans = left + right
if ans > len(l):
	print(len(l))
else:
	print(ans)


(n, k) = map(int, input().split())
li = list(map(int, input().split()))
(s, e) = (-1, -1)
for i in range(n):
	if s == -1:
		if li[i] > k:
			s = i
	if li[i] > k:
		e = i
if e == -1:
	print(n)
else:
	print(n - (e - s + 1))


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
i = 0
h = 1
c = 0
p = 0
s = 1
while i < n:
	if l[i] <= k:
		p += 1
	else:
		c += 1
		i = n
		h = -1
	if c == 2:
		s = 0
		print(p)
		break
	i += h
if s == 1:
	print(n)


def calc(n, m, a):
	i = 0
	j = n - 1
	count = 0
	while i <= j:
		if a[i] <= m:
			count += 1
			i += 1
		elif a[j] <= m:
			count += 1
			j -= 1
		elif a[i] > m and a[j] > m:
			break
	print(count)
(n, m) = list(map(int, input().split()))
a = list(map(int, input().split()))
calc(n, m, a)


def main():
	(n, k) = map(int, input().split())
	problems = list(map(int, input().split()))
	while len(problems) != 0:
		if k >= problems[0]:
			problems.pop(0)
		elif k >= problems[-1]:
			problems.pop()
		else:
			break
	print(n - len(problems))
main()


(n, k) = [int(inp) for inp in input().split()]
a = [int(inp) for inp in input().split()]
counter = 0
left = None
for (i, el) in enumerate(a):
	if el > k:
		left = i
		break
if left is None:
	print(len(a))
	exit()
for i in reversed(range(n)):
	if a[i] > k:
		right = i
		break
print(left + n - right - 1)


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
flag = 0
for i in range(n):
	if arr[i] <= k:
		flag = flag + 1
	else:
		break
if flag != n:
	for j in reversed(range(n)):
		if arr[j] <= k:
			flag = flag + 1
		else:
			break
print(flag)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
i = 0
c = 1
while c and i < n:
	if l[i] <= k:
		i += 1
	else:
		c = 0
sum = i
c = 1
i = n - 1
while c and i > sum:
	if l[i] <= k:
		i -= 1
	else:
		c = 0
sum += n - 1 - i
print(sum)


a = input()
a = a.split()
l = int(a[0])
m = int(a[1])
b = input()
b = b.split()
s = 0
for i in range(l):
	x = b[i]
	x = int(x)
	if x <= m:
		s += 1
	else:
		break
b.reverse()
for i in range(l):
	x = b[i]
	x = int(x)
	if x <= m:
		s += 1
	else:
		break
if s > l:
	print(l)
else:
	print(s)


(n, k) = map(int, input().split())
d = [int(x) for x in input().split()]
cf = cb = 0
for i in d:
	if i > k:
		break
	cf += 1
d.reverse()
for i in d:
	if i > k:
		break
	cb += 1
print(min(n, cb + cf))


def solve(ls, k):
	res = 0
	idx = 0
	for (i, num) in enumerate(ls):
		if num <= k:
			res += 1
			idx = i
		else:
			break
	for i in range(len(ls) - 1, idx, -1):
		if ls[i] <= k:
			res += 1
		else:
			break
	return res
(_, k) = list(map(int, input().split()))
ls = list(map(int, input().split()))
print(solve(ls, k))


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
i = 0
j = n - 1
count = 0
f = 0
for i in range(n):
	if l[i] <= k:
		count += 1
	else:
		f = 1
		break
c2 = 0
f1 = 0
for j in range(n - 1, 0, -1):
	if l[j] <= k:
		c2 += 1
	else:
		f1 = 1
		break
if n == 1 and l[0] > k:
	print(0)
elif i < j:
	print(count + c2)
elif f == 1 and f1 == 1:
	print(n - 1)
else:
	print(n)


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
for i in range(a):
	if l[i] <= b:
		c += 1
	else:
		break
for i in range(a - 1, -1, -1):
	if l[i] <= b:
		c += 1
	else:
		break
print(min(a, c))


inp = input()
n = int(inp.split(' ')[0])
k = int(inp.split(' ')[1])
c = 0
list = input().split(' ')
for i in range(0, n):
	list[i] = int(list[i])
while len(list) > 0 and list[0] <= k:
	list.pop(0)
	c += 1
list.reverse()
while len(list) > 0 and list[0] <= k:
	list.pop(0)
	c += 1
print(c)


from functools import cmp_to_key
s = input()
s = s.split(' ')
n = int(s[0])
k = int(s[1])
s = input()
s = s.split(' ')
a = []
for i in range(0, n):
	a.append(int(s[i]))
x = -1
y = n
for i in range(0, n):
	if a[i] <= k:
		x = i
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		y = i
	else:
		break
if y <= x:
	print(n)
else:
	print(n - y + x + 1)


(n, k) = map(int, input().split())
tasks = list(map(int, input().split()))
counter = 0
for i in range(0, n):
	if tasks[i] <= k:
		counter += 1
	else:
		break
if counter != n:
	for i in range(n - 1, -1, -1):
		if tasks[i] <= k:
			counter += 1
		else:
			break
print(counter)


import sys
import math
import bisect

def main():
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	if max(A) <= m:
		print(n)
	else:
		i = 0
		j = n - 1
		while i < n and A[i] <= m:
			i += 1
		while j >= 0 and A[j] <= m:
			j -= 1
		print(n - (j - i + 1))
main()


(n, k) = map(int, input().split())
s = [int(i) for i in input().split()]
a = 0
b = n - 1
ans = 0
while a < len(s) and b >= 0 and (s[a] <= k or s[b] <= k):
	if s[a] <= k:
		ans += 1
		a += 1
		continue
	ans += 1
	b -= 1
print(ans)


import sys
data = sys.stdin.readlines()
lis = []
for line in data:
	lis.append(line)
(n, k) = list(map(int, lis[0].split()))
seq = list(map(int, lis[1].split()))
ctr = 0
while seq:
	if seq[0] <= k:
		ctr += 1
		seq.pop(0)
	else:
		break
while seq:
	if seq[-1] <= k:
		ctr += 1
		seq.pop(-1)
	else:
		break
print(ctr)


(n, k) = map(int, input().split())
b = list(map(int, input().split()))
j = 0
q = 0
r = 0
while j < n:
	if b[j] > k:
		q = j + 1
		break
	j += 1
j = n - 1
while j >= 0:
	if b[j] > k:
		r = n - j - 1
		break
	j += -1
if q == 0:
	print(n)
else:
	print(q + r - 1)


s = input()
l = int(s.split()[0])
c = int(s.split()[1])
cpt = 0
li = list()
for k in input().split():
	li.append(int(k))
for i in li:
	if i <= c:
		cpt += 1
	else:
		break
if cpt != len(li):
	for i in li[::-1]:
		if i <= c:
			cpt += 1
		else:
			break
print(cpt)


(n, k) = input().split()
n = int(n)
k = int(k)
a = input().split()
a = [int(i) for i in a]
for (i, p) in enumerate(a):
	if p > k:
		out = i
		for (j, q) in enumerate(reversed(a)):
			if q > k:
				out += j
				break
		break
else:
	out = len(a)
print(out)


(n, m) = list(map(int, input().strip().split()))
l = list(map(int, input().strip().split()))
if max(l) <= m:
	print(n)
else:
	t = 0
	for j in l:
		if j <= m:
			t += 1
		else:
			p = l[::-1]
			for j in p:
				if j <= m:
					t += 1
				else:
					print(t)
					break
			break
	else:
		print(t)


(n, k) = list(map(int, input().split()))
arr = list(map(int, input().split()))
off = -1
ans = 0
for (idx, val) in enumerate(arr):
	if val <= k:
		ans += 1
	else:
		off = idx
		break
if off != -1:
	arr = arr[off:]
	arr = reversed(arr)
	for val in arr:
		if val <= k:
			ans += 1
		else:
			break
print(ans)


(n, k) = map(int, input().split())
a = [int(m) for m in input().split()]
while len(a) > 0:
	if a[0] <= k:
		a.pop(0)
	else:
		break
while len(a) > 0:
	if a[len(a) - 1] <= k:
		a.pop()
	else:
		break
print(n - len(a))


(n, k) = map(int, input().split())
data = map(int, input().split())
data = list(data)
l = 0
r = n - 1
ans = 0
while True:
	can = False
	if l > r:
		break
	if data[l] <= k:
		l += 1
		ans += 1
		can = True
	if l > r:
		break
	if data[r] <= k:
		r -= 1
		ans += 1
		can = True
	if not can:
		break
print(ans)


arr = list(map(int, input().split(' ')))
ar = list(map(int, input().split(' ')))
t = 0
for i in range(arr[0]):
	if ar[i] > arr[1]:
		t = ar.index(ar[i])
		break
ar.reverse()
z = 0
for each in ar:
	if each > arr[1]:
		z = ar.index(each)
		break
ar = sorted(ar)
s = 0
for h in ar:
	if h > arr[1]:
		s = 1
if s == 0:
	print(arr[0])
else:
	print(z + t)


(n, m) = map(int, input().split())
ar = list(map(int, input().split()))
ans = 0
lst = 0
for i in range(n):
	lst = i
	if ar[i] > m:
		break
	ans = ans + 1
for i in range(n - 1, lst, -1):
	if ar[i] > m:
		break
	ans = ans + 1
print(ans)


(x, y) = map(int, input().split())
A = list(map(int, input().split()))
(n, count) = ([], 0)
for i in range(len(A)):
	if A[i] > y:
		count += 1
		break
	else:
		n.append(A[i])
A.reverse()
for i in range(len(A)):
	if A[i] > y:
		count += 1
		break
	else:
		n.append(A[i])
if count == 0:
	print(x)
else:
	print(len(n))


f = lambda : map(int, input().split())
(n, k) = f()
a = list(f())
(ans, l, r) = (0, 0, n - 1)
while True:
	if l > r:
		break
	if l == r and a[l] <= k:
		ans += 1
		break
	if a[l] > k and a[r] > k:
		break
	if a[l] <= k:
		l += 1
		ans += 1
	if a[r] <= k:
		r -= 1
		ans += 1
print(ans)


(n, k) = map(int, input().split())
list1 = list(map(int, input().split()))
global cout
cout = 0
m = len(list1)
for i in range(m):
	if list1[i] <= k:
		cout += 1
		list1[i] = k + 1
	else:
		break
list1.reverse()
for i in range(m):
	if list1[i] <= k:
		cout += 1
		list1[i] = k + 1
	else:
		break
print(cout)


(n, s) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
while i < n and min(a[0], a[-1]) <= s:
	i += 1
	k = min(a[0], a[-1])
	if k == a[0]:
		a.remove(k)
	else:
		a.pop()
print(i)


(n, k) = map(int, input().split())
a = [int(i) for i in input().split()]
game = 1
res = 0
while game:
	try:
		if a[0] <= k:
			a.remove(a[0])
			res += 1
		if a[-1] <= k:
			a.reverse()
			a.remove(a[0])
			res += 1
		if not a[0] <= k and (not a[-1] <= k):
			game = 0
	except:
		break
print(res)


(n, k) = map(int, input().split())
li1 = list(map(int, input().split()))
a = 0
b = 0
coun = -0
for i in range(n):
	if li1[i] <= k and a == 0:
		coun += 1
		li1[i] = -10
	elif li1[i] > k:
		a = 1
		break
for i in range(n)[::-1]:
	if li1[i] <= k and li1[i] != -10 and (b == 0):
		coun += 1
		li1[i] = -10
	elif li1[i] > k:
		b = 1
		break
print(coun)


(n, k) = map(int, input().split())
problem_list = list(map(int, input().split()))
ans = 0
for item in problem_list:
	if item <= k:
		ans += 1
	else:
		break
if ans != n:
	for item in reversed(problem_list):
		if item <= k:
			ans += 1
		else:
			break
print(ans)


(n, k) = map(int, input().split())
a = [int(i) for i in input().split()]
t = 0
for i in range(n):
	if a[i] <= k:
		t += 1
		a[i] = k + 1
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		t += 1
	else:
		break
print(t)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
flag = 0
for i in a:
	if i > k:
		flag = 1
		break
	count += 1
a.reverse()
for i in a:
	if i > k:
		break
	count += 1
if flag == 0:
	print(n)
else:
	print(count)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
N = 0
for x in range(len(a)):
	if a[0] <= k or a[len(a) - 1] <= k:
		N += 1
		if a[0] <= k:
			del a[0]
		else:
			del a[len(a) - 1]
	else:
		break
print(N)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
mish = 0
for i in range(n):
	if a[i] > k:
		mish += i
		break
else:
	mish = n
if mish != n:
	for i in range(n - 1, -1, -1):
		if a[i] > k:
			mish += n - i - 1
			break
print(mish)


(n, k) = map(int, input().split())
l = [int(x) for x in input().split()]
i = 0
j = n - 1
f = 0
c = 0
while f == 0 and i < n and (j >= 0):
	if l[i] <= k:
		c += 1
		i = i + 1
	elif l[j] <= k:
		c += 1
		j = j - 1
	else:
		f = 1
		break
print(c)


def maxProbs(l, k, n):
	i = 0
	j = len(l) - 1
	num = 0
	while l[i] <= k:
		num += 1
		i += 1
		if i >= n:
			break
	while l[j] <= k and j > i:
		num += 1
		j -= 1
	return num
(n, k) = map(int, input().split())
l = [int(i) for i in input().split()]
num = maxProbs(l, k, n)
print(num)


(n, k) = [int(x) for x in input().split()]
problems = [int(x) for x in input().split()]
probs = problems[:]
for i in range(2):
	while len(probs) > 0:
		if probs[-1] <= k:
			probs.pop()
		else:
			break
	probs = probs[::-1]
print(n - len(probs))


(n, k) = map(int, input().split())
arr = [int(x) for x in input().split()]
ans = 0

def solve(arr):
	temp = 0
	for x in arr:
		if x <= k:
			temp += 1
		else:
			break
	return temp
ans = solve(arr)
ans += solve(arr[ans:][::-1])
print(ans)


(n, k) = (int(x) for x in input().split())
p = [int(x) for x in input().split()]
i = 0
r1 = 0
r2 = 0
while r1 is 0 or r2 is 0:
	try:
		if i % 2 is 0:
			if p[0] <= k:
				del p[0]
			else:
				r1 = 1
		elif p[-1] <= k:
			del p[-1]
		else:
			r2 = 1
		i += 1
	except:
		break
print(n - len(p))


(n, k) = input().split()
(n, k) = [int(n), int(k)]
a = [int(i) for i in input().split()]
c = 0
i = 0
j = n - 1
while i < n and j >= 0:
	if a[i] <= k and a[j] <= k:
		c += 1
		i += 1
	elif a[i] <= k:
		c += 1
		i += 1
	elif a[j] <= k:
		c += 1
		j -= 1
	else:
		break
print(c)


(n, k) = map(int, input().split(' '))
alist = list(map(int, input().split()))
i = 0
count = 0
for i in range(0, n, 1):
	if alist[i] <= k:
		count += 1
	else:
		break
if n - 1 >= 1:
	for j in range(n - 1, i, -1):
		if alist[j] <= k:
			count += 1
		else:
			break
print(count)


(n, k) = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
answer = 0
left = 0
right = 0
i = 0
while i < len(a) and i + left <= n - i - 1 + right:
	ends_levels = (a[i + left], a[n - i - 1 + right])
	if i + left < n - i - 1 + right:
		if k >= ends_levels[0] and k >= ends_levels[1]:
			answer += 2
		elif k >= ends_levels[0] or k >= ends_levels[1]:
			answer += 1
		if k < ends_levels[0]:
			left -= 1
		if k < ends_levels[1]:
			right += 1
		if k < ends_levels[0] and k < ends_levels[1]:
			break
	if i + left == n - i - 1 + right and a[i + left] <= k:
		answer += 1
	i += 1
print(answer)


(n, k) = input().split()
(n, k) = (int(n), int(k))
a = [int(i) for i in input().split()]
while a[0] <= k and a != []:
	a = a[1:]
	if a == []:
		break
if a != []:
	while a[-1] <= k and a != []:
		a = a[:-1]
print(n - len(a))


t = input()
t = t.split()
n = int(t[0])
k = int(t[1])
p = 0
a = input()
a = a.split()
for x in range(n):
	a[p] = int(a[p])
	p = p + 1
i = 0
j = 0
e = -1
for x in range(n):
	if k >= a[i]:
		j = j + 1
		i = i + 1
	elif k >= a[e]:
		e = e - 1
		j = j + 1
	else:
		break
print(j)


(n, k) = map(int, input().split())
l = [int(n) for n in input().split()]
i = 0
count = 0
while len(l) > 0:
	n = len(l)
	if l[0] > k and l[n - 1] > k:
		break
	if l[0] <= k and l[0] <= l[n - 1]:
		l = l[1:n]
	elif l[0] > l[n - 1] and l[n - 1] <= k:
		l = l[0:n - 1]
	count += 1
print(count)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
(n, k) = zz()
arr = zzz()
(l, r) = (0, n - 1)
c = 0
d = 0
while l <= r:
	if arr[l] <= k:
		l += 1
	else:
		c = 1
	if arr[r] <= k:
		r -= 1
	else:
		d = 1
	if c + d == 2:
		break
print(min(n, l + (n - r - 1)))


(n, k) = map(int, input().split())
ar = list(map(int, input().split()))
count = 0
while len(ar) > 0 and ar[0] <= k:
	count += 1
	ar.pop(0)
while len(ar) > 0 and ar[-1] <= k:
	count += 1
	ar.pop()
print(count)


def cntFromLeft(A, N, K):
	cnt = 0
	for i in range(N):
		if A[i] <= K:
			cnt += 1
		else:
			return cnt
	return cnt

def cntFromRight(A, N, K):
	cnt = 0
	for i in range(N - 1, -1, -1):
		if A[i] <= K:
			cnt += 1
		else:
			return cnt
	return cnt

def both(A, N, k):
	i = 0
	j = N - 1
	cnt = 0
	while True:
		try:
			if A[i] <= k:
				i += 1
			elif A[j] <= k:
				j -= 1
			else:
				return cnt
		except:
			return cnt
		cnt += 1
	return cnt
(N, K) = map(int, input().split())
A = list(map(int, input().split()))
print(both(A, N, K))


def parseInt(s):
	return int(s)

def f():
	arrlen = list(map(parseInt, input().split()))
	arr = list(map(parseInt, input().split()))
	cont = 0
	probs = 0
	while len(arr) > 0 and (arr[0] <= arrlen[1] or arr[len(arr) - 1] <= arrlen[1]):
		if arr[0] <= arrlen[1]:
			probs += 1
			del arr[0]
		elif arr[len(arr) - 1] <= arrlen[1]:
			probs += 1
			del arr[len(arr) - 1]
		cont += 1
	print(probs)
f()


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
for i in range(n):
	if a[i] <= k:
		s = s + 1
	else:
		break
s2 = 0
for j in range(n):
	i = n - j - 1
	if a[i] <= k and i > s:
		s2 += 1
	else:
		break
print(s + s2)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
l = max(a)
if l <= k:
	print(n)
else:
	i = 0
	p = 0
	while i < n:
		if a[i] <= k:
			p = p + 1
		else:
			break
		i += 1
	i = n - 1
	while i >= 0:
		if a[i] <= k:
			p = p + 1
		else:
			break
		i -= 1
	print(p)


l = input().split()
k = int(l[1])
l = input().split()
i = 0
for j in range(len(l)):
	l[j] = int(l[j])
while len(l) > 0 and l[0] <= k:
	i += 1
	del l[0]
while len(l) > 0 and l[-1] <= k:
	i += 1
	del l[-1]
print(i)


(x, y) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
f = 0
for i in a:
	if i > y:
		f = 1
		break
	ans += 1
if f:
	a = a[::-1]
	for i in a:
		if i > y:
			break
		ans += 1
print(ans)


line = input().split()
k = int(line[1])
arr = input().split()
arr = list(map(lambda x: int(x), arr))
left = 0
right = 0
i = 0
while i < len(arr) and arr[i] <= k:
	left += 1
	i += 1
i = len(arr) - 1
while i >= 0 and arr[i] <= k:
	right += 1
	i -= 1
print(min(left + right, len(arr)))


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
l1 = []
for i in range(len(l)):
	if l[i] <= k:
		l1.append(l[i])
	else:
		break
l = list(reversed(l))
for i in range(n - len(l1)):
	if l[i] <= k:
		l1.append(l[i])
	else:
		break
print(len(l1))


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
cnt = 0
d = 0
x = []
y = []
for i in range(a):
	if c[i] <= b:
		cnt += 1
		x.append(c[i])
	else:
		break
for i in range(a):
	if c[a - 1 - i] <= b:
		y.append(c[a - 1 - i])
	else:
		break
if len(x) == len(y) == a:
	print(len(x))
else:
	print(len(x) + len(y))


(n, k) = (int(x) for x in input().split())
x = [int(x) for x in input().split()]
l = -1
r = -1
for i in range(n):
	if x[i] > k:
		l = i
		break
for i in range(n - 1, -1, -1):
	if x[i] > k:
		r = i
		break
if r == -1 and l == -1:
	print(n)
elif l == r:
	print(n - 1)
else:
	print(n - (r - l + 1))


n_k = input().split()
n = int(n_k[0])
k = int(n_k[1])
sol = 0
a = list(map(int, input().split()))
while a and a[0] <= k:
	a.pop(0)
	sol += 1
a.reverse()
while a and a[0] <= k:
	a.pop(0)
	sol += 1
print(sol)


(n, k) = input().split()
(n, k) = [int(n), int(k)]
list = [int(x) for x in input().split()]
c = 0
i = 0
while n > i and list[i] <= k:
	c += 1
	i += 1
i = n - 1
if n == c:
	print(c)
else:
	while i >= 0 and list[i] <= k:
		c += 1
		i -= 1
	print(c)


import sys
(n, k) = map(int, sys.stdin.readline().split())
l = list(map(int, sys.stdin.readline().split()))
total = 0
solvable = True
while l != [] and solvable:
	solvable = False
	if l[0] <= k:
		total += 1
		l.pop(0)
		solvable = True
	elif l[len(l) - 1] <= k:
		total += 1
		l.pop(len(l) - 1)
		solvable = True
print(total)


(n, k) = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
ans = 0
while 1:
	flag = 0
	if len(q) > 0 and q[0] <= k:
		ans += 1
		del q[0]
		flag += 1
	if len(q) > 0 and q[-1] <= k:
		ans += 1
		del q[-1]
		flag += 1
	if flag == 0:
		break
print(ans)


(n, k) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
ans = 0
i = 0
flag = 0
j = n - 1
while i <= j:
	if a[i] <= k:
		ans += 1
		i += 1
		continue
	if a[j] <= k:
		ans += 1
		j -= 1
	if a[i] > k and a[j] > k:
		break
print(ans)


def main():
	[n, k] = map(int, input().split())
	arr = list(map(int, input().split()))
	ans = 0
	le = 0
	while le < len(arr):
		if arr[le] > k:
			break
		ans += 1
		le += 1
	if le < len(arr):
		ri = len(arr) - 1
		while ri >= 0:
			if arr[ri] > k:
				break
			ans += 1
			ri -= 1
	print(ans)
main()


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in a:
	if i > k:
		break
	else:
		cnt += 1
for i in a[::-1]:
	if i > k:
		break
	else:
		cnt += 1
if cnt == 2 * n:
	cnt //= 2
print(cnt)


(n, m) = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in l:
	if i <= m:
		s += 1
	else:
		break
if n != s:
	for i in range(n - 1, -1, -1):
		if l[i] <= m:
			s += 1
		else:
			break
print(s)


(m, n) = map(int, input().split())
nums = list(map(int, input().split()))
a = 0
b = len(nums) - 1
total = 0
if max(nums) <= n:
	print(len(nums))
else:
	while nums[a] <= n or nums[b] <= n:
		if nums[a] <= n:
			total = total + 1
			a = a + 1
		if nums[b] <= n:
			total = total + 1
			b = b - 1
	print(total)


(n, k) = map(int, input().split())
mat = list(map(int, input().split()))
result = 0
for i in range(n):
	if mat[i] > k:
		break
	result += 1
for j in range(n - 1, i, -1):
	if mat[j] > k:
		break
	result += 1
print(result)


n = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
count = 0
while len(a) != 0:
	if a[0] > n[1] and a[-1] > n[1]:
		break
	if a[0] <= n[1]:
		del a[0]
		count = count + 1
	elif a[-1] <= n[1]:
		del a[-1]
		count = count + 1
print(count)


(s, k) = [int(x) for x in input().split()]
n = [int(x) for x in input().split()]
lr = 0
rl = 0
for i in range(0, s):
	if n[i] <= k:
		lr += 1
	else:
		break
if lr != s:
	for i in range(s - 1, -1, -1):
		if n[i] <= k:
			rl += 1
		else:
			break
print(lr + rl)


inp = input().split()
n = int(inp[0])
a = int(inp[1])
lst = input().split()
intLst = [int(i) for i in lst]
count = 0
while intLst:
	if intLst[0] <= a:
		count += 1
		intLst = intLst[1:]
	elif intLst[-1] <= a:
		count += 1
		intLst = intLst[:-1]
	else:
		break
print(count)


n = [int(num) for num in input().split()]
a = [int(num) for num in input().split()]
count = 0
while len(a) > 0:
	if a[0] < n[1] + 1:
		a.pop(0)
		count = count + 1
	elif a[-1] < n[1] + 1:
		a.pop(-1)
		count = count + 1
	else:
		break
print(count)


(n, k) = map(int, input().split())
ls = list(map(int, input().split()))
cnt = 0
for i in range(len(ls)):
	if ls[i] <= k:
		cnt += 1
	else:
		break
if i != len(ls) - 1:
	for j in range(len(ls) - 1, 0, -1):
		if ls[j] <= k:
			cnt += 1
		else:
			break
print(cnt)


(n, k) = map(int, input().split())
alist = list(map(int, input().split()))
count = 0
i = 0
while i < n and alist[i] <= k:
	i += 1
count += i
alist.reverse()
i = 0
while i < n and alist[i] <= k:
	i += 1
count += i
print(min(n, count))


def reshenie(lst, k):
	(count, count1) = (0, 0)
	if all((i <= k for i in lst)):
		return len(lst)
	elif lst[0] > k and lst[len(lst) - 1] > k:
		return 0
	else:
		for i in range(len(lst) - 1):
			if lst[i] <= k:
				count += 1
			else:
				break
		for i in range(len(lst) - 1):
			if lst[len(lst) - i - 1] <= k:
				count1 += 1
			else:
				break
		return count + count1
(s, m) = [int(j) for j in input().split()]
a = [int(i) for i in input().split()]
print(reshenie(a, m))


(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
ans = 0
while len(a) > 0 and k >= a[0]:
	ans += 1
	a.remove(a[0])
while len(a) > 0 and k >= a[len(a) - 1]:
	ans += 1
	a = a[:-1]
print(ans)


(n, k) = list(map(int, input().split()))
t = list(map(int, input().split()))
i = 0
cnt = 0
while t[i] <= k:
	i += 1
	cnt += 1
	if i == n:
		break
if i < n:
	j = n - 1
	while t[j] <= k:
		j -= 1
		cnt += 1
print(cnt)


(n, k) = map(int, input().split())
list1 = list(map(int, input().split()))
count = 0
for i in range(n):
	if list1[0] <= k:
		count += 1
		list1.pop(0)
	elif list1[-1] <= k:
		count += 1
		list1.pop()
	elif list1[-1] > k and list1[0] > k:
		break
print(count)


f = lambda : map(int, input().split())
(n, k) = f()
c = 0
l = list(f())
while (l[0] <= k or l[-1] <= k) and len(l) > 1:
	if l[0] <= k:
		c += 1
		l.pop(0)
	elif l[-1] <= k:
		c += 1
		l.pop(-1)
	else:
		break
print(c + 1 if l[0] <= k else c)


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
c = 0
while l != [] and l[-1] <= b:
	c += 1
	l.pop()
l = l[::-1]
while l != [] and l[-1] <= b:
	c += 1
	l.pop()
print(c)


from collections import deque
(n, k) = map(int, input().split())
elements = list(map(int, input().split()))
d = deque(elements)
count = 0
while True:
	if len(d) != 0:
		if d[0] <= k:
			count += 1
			d.popleft()
		elif d[-1] <= k:
			count += 1
			d.pop()
		else:
			break
	else:
		break
print(count)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
i = 0
c = 0
while l:
	if l[i] <= k:
		l.pop(0)
	elif l[-1] <= k:
		l.pop(-1)
	else:
		break
	c = c + 1
print(c)


import itertools
(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
bs = list(itertools.dropwhile(lambda x: x <= k, arr))
es = list(itertools.dropwhile(lambda x: x <= k, reversed(bs)))
print('{}'.format(n - len(es)))


tmp = input().split()
n = int(tmp[0])
k = int(tmp[1])
tmp = input().split()
a = []
for i in tmp:
	a.append(int(i))
ans = 0
i = 0
j = n - 1
f = 1
while i < j:
	if a[i] <= k:
		ans += 1
		i += 1
	elif a[j] <= k:
		j -= 1
		ans += 1
	else:
		f = 0
		break
if f and a[i] <= k:
	ans += 1
print(ans)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
l = 0
test = True
oops = True
index = -1
for i in range(n):
	if test and k >= a[i]:
		l += 1
	elif test and k < a[i]:
		test = False
		index = i
if index != -1:
	for i in range(n - 1, index, -1):
		if oops and k >= a[i]:
			l += 1
		else:
			oops = False
print(l)


import math
[a, b] = map(int, input().split())
z = list(input().split())
n = 0
for i in range(a):
	if b < int(z[i]):
		break
	else:
		n = n + 1
for d in reversed(range(a)):
	if b < int(z[d]):
		break
	elif i >= d:
		break
	else:
		n = n + 1
print(n)


nk = list(map(int, input().split()))
a = list(map(int, input().split()))
cnt = 0
ok = True
while ok:
	if a[0] <= nk[1]:
		cnt += 1
		a.pop(0)
		if len(a) == 0:
			break
	else:
		ok = False
ok = True
if len(a) > 0:
	while ok:
		if a[len(a) - 1] <= nk[1]:
			cnt += 1
			a.pop(len(a) - 1)
			if len(a) == 0:
				break
		else:
			ok = False
print(cnt)


import sys
a = sys.stdin.read()
a = a.split('\n')
info = a[0].split()
ability = int(info[1])
problem = a[1].split()
count = 0
reverse = False
for i in problem:
	if int(i) <= ability:
		count += 1
	else:
		reverse = True
		break
if reverse:
	for i in problem[::-1]:
		if int(i) <= ability:
			count += 1
		else:
			break
print(count)


def read_nums():
	return [int(x) for x in input().split()]

def main():
	(n, k) = read_nums()
	nums = read_nums()
	res = 0
	index = 0
	for num in nums:
		if num > k:
			break
		res += 1
		index += 1
	r_index = n - 1
	while r_index > index:
		num = nums[r_index]
		if num > k:
			break
		res += 1
		r_index -= 1
	print(res)
main()


(n, k) = map(int, input().split(' '))
li = [int(x) for x in input().split(' ')]
count = 0
i = len(li) - 1
while i >= 0 and li[i] <= k:
	count += 1
	i -= 1
	li.pop()
leng = len(li)
i = 0
while i < leng and li[i] <= k:
	count += 1
	i += 1
print(count)


def Bitplus():
	n = int(input())
	x = 0
	for i in range(n):
		a = input()
		if '+' in a:
			x += 1
		else:
			x -= 1
	print(x)

def GiftSetidk():
	n = int(input())
	for i in range(n):
		all = input().split(' ')
		x = int(all[0])
		y = int(all[1])
		a = int(all[2])
		b = int(all[3])
		counter = 0
		count = True
		while count:
			if x >= a and y >= b:
				x -= a
				y -= b
				counter += 1
			elif x >= b and y >= a:
				x -= b
				y -= a
				counter += 1
			else:
				count = False
		print(counter)

def Team():
	n = int(input())
	problemcount = 0
	for i in range(n):
		count = 0
		answer = input().split(' ')
		for i in range(len(answer)):
			answer[i] = int(answer[i])
		for i in answer:
			if i == 1:
				count += 1
		if count >= 2:
			problemcount += 1
	print(problemcount)

def NextRound():
	nk = input().split(' ')
	n = int(nk[0])
	k = int(nk[1])
	print(n, k)
	scores = input().split(' ')
	count = 0
	for i in range(n):
		scores[i] = int(scores[i])
	five = scores[k]
	for i in range(n):
		if scores[i] >= five and scores[i] > 0:
			count += 1
	print(count)

def Beautifulmatrix():
	steps = 0
	matrixes = []
	for i in range(5):
		i = [input().split(' ')]
		matrixes += i
	for i in range(5):
		for j in range(5):
			matrixes[i][j] = int(matrixes[i][j])
	for i in range(5):
		for j in range(5):
			if matrixes[i][j] > 0:
				x = j
				y = i
				break
	while x != 2 or y != 2:
		if x > 2:
			x -= 1
			steps += 1
		elif x < 2:
			x += 1
			steps += 1
		elif y > 2:
			y -= 1
			steps += 1
		elif y < 2:
			y += 1
			steps += 1
	print(steps)

def HelpfulMahts():
	s = input().split('+')
	s.sort()
	print('+'.join(s))

def WordCapitalization():
	word = input()
	List = []
	for i in word:
		List.append(i)
	List[0] = List[0].upper()
	s = ''
	for i in List:
		s += i
	print(s)

def Stonesonthetable():
	n = int(input())
	stones = []
	rrg = input()
	counter = 0
	for i in rrg:
		stones.append(i)
	for i in range(n - 1):
		if stones[i] == stones[i + 1]:
			counter += 1
	print(counter)

def BearandBigBrother():
	inpuut = input().split(' ')
	a = int(inpuut[0])
	b = int(inpuut[1])
	year = 0
	while a <= b:
		a *= 3
		b *= 2
		year += 1
	print(year)

def Wrongsubtraction():
	nk = input().split(' ')
	n = int(nk[0])
	k = int(nk[1])
	for i in range(k):
		p = str(n)
		if p[len(p) - 1] == '0':
			n //= 10
		else:
			n -= 1
	print(n)
import string

def Word():
	word = input()
	lower = 0
	upper = 0
	for i in word:
		if i in string.ascii_lowercase:
			lower += 1
		else:
			upper += 1
	if upper > lower:
		word = word.upper()
	else:
		word = word.lower()
	print(word)

def QueueattheSchool():
	nt = input().split(' ')
	n = nt[0]
	t = int(nt[1])
	a = input()
	b = []
	ref = ''
	for i in a:
		b.append(i)
	for k in range(t):
		whre = []
		for i in range(len(b) - 1):
			if b[i] == 'B' and b[i + 1] != 'B':
				whre.insert(0, i)
		for j in whre:
			b.pop(j)
			b.insert(j + 1, 'B')
	for i in b:
		ref += i
	print(ref)

def Nearlyluckynumber():
	n = input()
	if n.count('7') + n.count('4') == 7 or n.count('7') + n.count('4') == 4:
		print('YES')
	else:
		print('NO')

def Translation():
	s = input()
	t = input()
	n = []
	for i in t:
		n.insert(0, i)
	t = ''
	for i in n:
		t += i
	if t == s:
		print('YES')
	else:
		print('NO')

def ANTONandDanik():
	n = int(input())
	s = input()
	A = s.count('A')
	D = s.count('D')
	if A > D:
		print('Anton')
	elif D > A:
		print('Danik')
	else:
		print('Friendship')

def GeorgeandAccomodation():
	n = int(input())
	rooms = 0
	for i in range(n):
		pq = input().split(' ')
		p = int(pq[0])
		q = int(pq[1])
		if q - p >= 2:
			rooms += 1
	print(rooms)

def Magnets():
	n = int(input())
	Rows = []
	groups = 1
	for i in range(n):
		Rows += [input()]
	for i in range(n - 1):
		if Rows[i] != Rows[i + 1]:
			groups += 1
	print(groups)

def InSearcoanEasyProblem():
	n = int(input())
	counter = 0
	s = input().split(' ')
	if '1' in s:
		print('HARD')
	else:
		print('EASY')

def Hulk():
	c = int(input())
	i = 'I'
	s = ''
	it = 'it'
	for i in range(1, c + 1):
		if i == 1:
			s += 'hate '
		elif i % 2 == 0:
			s += 'that I love '
		else:
			s += 'that I hate '
	print(f'I {s}it')

def CalculatingFunctionidk():
	n = int(input())
	c = 0
	for i in range(1, n + 1):
		if i % 2 != 0:
			c -= i
		else:
			c += i
	print(c)

def IWannaBetheGuyidk():
	n = int(input())
	p = input().split(' ')
	q = input().split(' ')
	counter = 0
	for i in range(1, n + 1):
		if str(i) in p or str(i) in q:
			counter += 1
	if counter == n:
		print('I become the guy.')
	else:
		print('Oh, my keyboard!')

def horsesheo():
	n = input().split(' ')
	many = 4
	whatwas = []
	for i in range(len(n)):
		n[i] = int(n[i])
		if n[i] not in whatwas:
			whatwas.append(n[i])
	print(many - len(whatwas))

def ArrivaloftheGeneralidk():
	n = int(input())
	a = input().split(' ')
	max = 0
	minlist = []
	for i in range(n):
		a[i] = int(a[i])
	for i in a:
		if i > max:
			max = i
	maxloc = a.index(max)
	for i in a:
		minlist.insert(0, i)
	min = max
	for i in a:
		if i < min:
			min = i
	minloc = minlist.index(min)
	print(minloc + maxloc)

def UltraFastMathematician():
	first = input()
	second = input()
	s = ''
	for i in range(len(first)):
		if first[i] == '0' and second[i] == '1':
			s += '1'
		elif first[i] == '1' and second[i] == '0':
			s += '1'
		elif first[i] == '0' and second[i] == '0':
			s += '0'
		elif first[i] == '1' and second[i] == '1':
			s += '0'
	print(s)

def Insomniacure():
	klmn = []
	for i in range(4):
		klmn.append(int(input()))
	d = int(input())
	List = []
	if 1 in klmn:
		return d
	for i in range(4):
		mulit = klmn[i]
		while klmn[i] <= d:
			if klmn[i] not in List:
				List.append(klmn[i])
			klmn[i] += mulit
	return len(List)

def AntonandLetters():
	first = input()
	List = []
	for i in first:
		if i not in List and i in string.ascii_lowercase:
			List.append(i)
	print(len(List))

def Pangram():
	n = int(input())
	word = input().lower()
	List = []
	if n >= 26:
		for i in word:
			if i not in List:
				List.append(i)
		if len(List) == 26:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')

def Collectingcoons():
	n = int(input())
	for i in range(n):
		abcd = input().split(' ')
		for i in range(len(abcd)):
			abcd[i] = int(abcd[i])
		d = abcd[3]
		abcd.pop()
		maxi = 0
		for i in abcd:
			if i > maxi:
				maxi = i
		allindexes = [0, 1, 2]
		indexmax = abcd.index(maxi)
		allindexes.pop(indexmax)
		allminus = 0
		for i in allindexes:
			allminus += abcd[indexmax] - abcd[i]
		d -= allminus
		if d % 3 == 0 and d >= 0:
			print('YES')
		else:
			print('NO')

def Brainsphotos():
	nm = input().split(' ')
	colors = []
	for i in range(int(nm[0])):
		colors += input().split(' ')
	for i in colors:
		if i == 'C' or i == 'M' or i == 'Y':
			return '#Color'
	return '#Black&White'

def SerejaandDima():
	n = int(input())
	card = input().split(' ')
	S = 0
	D = 0
	sturn = True
	for i in range(n):
		if int(card[0]) > int(card[len(card) - 1]):
			if sturn:
				S += int(card[0])
				card.pop(0)
				sturn = False
			else:
				D += int(card[0])
				card.pop(0)
				sturn = True
		elif sturn:
			S += int(card[len(card) - 1])
			card.pop(len(card) - 1)
			sturn = False
		else:
			D += int(card[len(card) - 1])
			card.pop(len(card) - 1)
			sturn = True
	print(f'{S} {D}')

def Vanyaandcubes():
	n = int(input())
	counter = 1
	countdodo = 0
	rows = 0
	while n > 0:
		countdodo += counter
		counter += 1
		rows += 1
		n -= countdodo
	if n == 0:
		print(rows)
	else:
		print(rows - 1)

def GennadyandaCarGame():
	card = input()
	cards = input().replace(' ', '')
	for i in card:
		for j in cards:
			if i == j:
				return 'YES'
	return 'NO'

def FafaandhisCompany():
	n = int(input())
	ways = 0
	for i in range(1, n):
		a = n
		a -= i
		if a % i == 0:
			ways += 1
	print(ways)

def Mahmoudandehabandtheevenoddgame():
	n = int(input())
	Mahmoudsturn = True
	Mahmoudlsot = False
	Ehablost = False
	a = 0
	while not Mahmoudlsot and (not Ehablost):
		if Mahmoudsturn:
			if n % 2 == 0 and n >= 2:
				Ehablost = True
			elif n % 2 != 0 and n >= 2:
				a = n - 1
			else:
				Mahmoudlsot = True
		elif n % 2 == 1 and n >= 1:
			Mahmoudlsot = True
		elif n % 2 == 0 and n >= 1:
			a = n - 1
		else:
			Ehablost = False
		n -= a
		if Mahmoudsturn == True:
			Mahmoudsturn = False
		else:
			Mahmoudsturn = True
	if Mahmoudlsot == True:
		print('Ehab')
	else:
		print('Mahmoud')

def FloorNumber():
	t = int(input())
	for i in range(t):
		nx = input().split(' ')
		n = int(nx[0])
		x = int(nx[1])
		aparteements = 2
		floor = 1
		while n > aparteements:
			aparteements += x
			floor += 1
		print(floor)

def VustheCossackandaContest():
	nmk = input().split(' ')
	n = int(nmk[0])
	m = int(nmk[1])
	k = int(nmk[2])
	if n <= m and n <= k:
		print('Yes')
	else:
		print('No')

def NightattheMuseum():
	word = input()
	rotations = 0
	lower = string.ascii_lowercase + string.ascii_lowercase + string.ascii_lowercase
	loc = lower.index('a', 26, 2 * 26)
	for i in word:
		cplus = loc
		cminus = loc
		keep = True
		while keep:
			if i == lower[cplus] or i == lower[cminus]:
				keep = False
			else:
				cplus += 1
				cminus -= 1
				rotations += 1
				loc = lower.index(i, 26, 2 * 26)
	print(rotations)

def OrdinarYnumbers():
	n = int(input())
	for i in range(n):
		k = int(input())
		counter = 0
		for j in range(1, k + 1):
			a = str(j)
			if len(a) == a.count(a[0]):
				counter += 1
		print(counter)

def DieRoll():
	n = input().split(' ')
	y = int(n[0])
	w = int(n[1])
	number = 0
	dec = 6
	if y >= w:
		for i in range(y, 7):
			number += 1
	else:
		for i in range(w, 7):
			number += 1
	if number % 6 == 0:
		number = number // 6
		dec = 1
	elif number % 3 == 0:
		number = number // 3
		dec = 2
	elif number % 2 == 0:
		number = number // 2
		dec = 3
	print(f'{number}/{dec}')

def Borze():
	n = input()
	l = ''
	k = ''
	for i in n:
		if i == '.' and len(l) == 0:
			k += '0'
		else:
			l += i
			if len(l) == 2:
				if l == '-.':
					k += '1'
					l = ''
				else:
					k += '2'
					l = ''
	print(k)

def FairPlayoff():
	n = int(input())
	for i in range(n):
		loser = {}
		winner = {}
		count = 0
		k = input().split(' ')
		if int(k[0]) > int(k[1]):
			loser['one'] = int(k[1])
			winner['two'] = int(k[0])
		else:
			loser['one'] = int(k[0])
			winner['two'] = int(k[1])
		if int(k[2]) > int(k[3]):
			loser['two'] = int(k[3])
			winner['one'] = int(k[2])
		else:
			loser['two'] = int(k[2])
			winner['one'] = int(k[3])
		for i in loser:
			if loser[i] < winner[i]:
				count += 1
		if count >= 2:
			print('YES')
		else:
			print('NO')

def Bustoudaylanbd():
	n = int(input())
	s = []
	rem = -1
	first = True
	ss = ''
	for i in range(n):
		s += input().split('|')
	for i in range(len(s)):
		if s[i] == 'OO' and first:
			rem = i
			s[i] = '++'
			first = False
	for i in range(len(s)):
		if i % 2 == 0:
			ss += s[i] + '|'
		else:
			ss += s[i] + '\n'
	if not first:
		print('YES')
		print(ss)
	else:
		print('NO')

def Maximumincrease():
	n = int(input())
	arraa = input().split(' ')
	for i in range(len(arraa)):
		arraa[i] = int(arraa[i])
	counter = {}
	for i in range(n):
		counter[i] = 0
	count = 0
	last = 0
	for i in arraa:
		if i > last:
			last = i
			counter[count] += 1
		else:
			last = i
			count += 1
			counter[count] += 1
	max = 0
	for i in range(n):
		if counter[i] > max:
			max = counter[i]
	print(max)

def Jugglingletters():
	n = int(input())
	for i in range(n):
		k = int(input())
		s = ''
		map = {}
		possible = True
		for i in range(k):
			s += input()
		for i in s:
			if i not in map:
				map[i] = 1
			else:
				map[i] += 1
		for i in map:
			if map[i] % k != 0:
				possible = False
		if possible:
			print('YES')
		else:
			print('NO')

def Panoramixsprediction():
	nm = input().split(' ')
	n = int(nm[0])
	m = int(nm[1])
	first = True
	for i in range(n + 1, m):
		count = 0
		for j in range(2, i):
			if i % j == 0:
				count += 1
		if count == 0:
			first = False
			break
	if first:
		count = 0
		for j in range(2, m):
			if m % j == 0:
				count += 1
		if count == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')

def ThreepilesofCanides():
	k = int(input())
	for i in range(k):
		n = input().split(' ')
		canides = 0
		for i in n:
			canides += int(i)
		if canides % 2 != 0:
			canides -= 1
		print(canides // 2)

def filename():
	n = int(input())
	name = input()
	more = 0
	map = {}
	map[more] = 0
	count = 0
	for i in name:
		if i == 'x':
			map[more] += 1
		elif map[more] != 0:
			more += 1
			map[more] = 0
	for i in map:
		if map[i] >= 3:
			while map[i] > 2:
				map[i] -= 1
				count += 1
	print(count)

def Football():
	map = {}
	current = 0
	s = input()
	f = s[0]
	map[current] = 0
	check = False
	for i in s:
		if i == f:
			map[current] += 1
		else:
			current += 1
			map[current] = 1
			f = i
	for i in map:
		if map[i] >= 7:
			check = True
	if check:
		print('YES')
	else:
		print('NO')

def CombinationLock1():
	n = int(input())
	fl = input()
	sl = input()
	count = 0
	for i in range(n):
		goup = int(fl[i])
		god = int(fl[i])
		cu = 0
		cd = 0
		keep = True
		while keep:
			if goup + 1 <= 9:
				goup += 1
				cu += 1
			else:
				goup = 0
				cu += 1
			if god - 1 >= 0:
				god -= 1
				cd += 1
			else:
				god = 9
				cd += 1
			if goup == int(sl[i]):
				count += cu
				keep = False
			elif god == int(sl[i]):
				count += cd
				keep = False
	print(count)

def Watermelon():
	n = int(input())
	down = n // 2
	up = n - down
	rge = up
	for i in range(rge):
		if up % 2 == 0 and down % 2 == 0:
			return print('YES')
		elif up + 1 < n and down - 1 > 0:
			up += 1
			down -= 1
		else:
			return print('NO')

def Dominopiling():
	nk = input().split(' ')
	n = int(nk[0])
	k = int(nk[1])
	mnk = n * k
	print(mnk // 2)

def yetanotherBookshelf():
	n = int(input())
	for i in range(n):
		le = int(input())
		K = input().split(' ')
		SK = []
		lili = []
		for i in range(le):
			if i + 1 <= le - 1:
				if K[i] == '1' and K[i + 1] == '1':
					lili.append(i)
		lili.reverse()
		for i in lili:
			K.pop(i)
		coun = 0
		while K.count('1') > 1:
			f = K.index('1')
			K.pop(f)
			K.insert(f + 1, '1')
			f += 1
			if K[f + 1] == '1':
				K.pop(f)
			coun += 1
		print(coun)

def Combinationlockittakestolong():
	n = int(input())
	fl = input()
	sl = input()
	counter = 0
	for i in range(n):
		up = int(fl[i])
		down = int(fl[i])
		while True:
			if up + 1 <= 9:
				up += 1
			else:
				up = 0
			if down - 1 >= 0:
				down -= 1
			else:
				down = 9
			counter += 1
			if up == int(sl) or down == int(sl):
				break

def iwannabetheguytolong():
	n = int(input())
	lvl = input().split(' ')
	lvls = input().split(' ')
	for i in range(1, n + 1):
		if str(i) not in lvl and str(i) not in lvls:
			return print('Oh, my keyboard!')
	return print('I become the guy.')

def giftsettolong():
	n = int(input())
	for i in range(n):
		rb = input().split(' ')
		x = int(rb[0])
		y = int(rb[1])
		a = int(rb[2])
		b = int(rb[3])
		giftset = 0
		while True:
			if x - a >= 0 and y - b >= 0:
				x -= a
				y -= b
				giftset += 1
			elif x - b >= 0 and y - a >= 0:
				x -= b
				y -= a
				giftset += 1
			else:
				break
		print(giftset)

def uniquwbidauctiontime():
	n = int(input())
	for i in range(n):
		k = int(input())
		list = input().split(' ')
		o = -1
		for i in range(k):
			if list.count(list[i]) == 1:
				if o == -1 or list[i] < o:
					o = list[i]
		if o != -1:
			print(list.index(o) + 1)
		else:
			print(o)

def equalizepriceagain():
	n = int(input())
	for i in range(n):
		k = int(input())
		numbers = input().split(' ')
		for i in range(len(numbers)):
			numbers[i] = int(numbers[i])
		total = 0
		for i in numbers:
			total += i
		if total % k == 0:
			print(total // k)
		else:
			while total % k != 0:
				total += 1
			print(total // k)

def shortsubstrings():
	n = int(input())
	for i in range(n):
		s = input()
		laist = []
		for i in range(len(s)):
			if i % 2 != 0 and i != len(s) - 1:
				laist.append(i)
		laist.reverse()
		s = list(s)
		for i in laist:
			s.pop(i)
		sa = ''
		for i in s:
			sa += i
		print(sa)

def policerecruits():
	n = int(input())
	k = input().split(' ')
	officers = 0
	crimes = 0
	for i in k:
		if int(i) == -1:
			if officers == 0:
				crimes += 1
			else:
				officers -= 1
		else:
			officers += int(i)
	print(crimes)

def thenewyear():
	xxx = input().split(' ')
	for i in range(len(xxx)):
		xxx[i] = int(xxx[i])
	xxx.sort()
	way = 0
	way += abs(int(xxx[1]) - int(xxx[0]))
	way += abs(int(xxx[1]) - int(xxx[2]))
	print(way)

def frogjumpingtimelimit():
	n = int(input())
	for i in range(n):
		abk = input().split(' ')
		a = int(abk[0])
		b = int(abk[1])
		k = int(abk[2])
		all = 0
		for i in range(k):
			if i % 2 == 0:
				all += a
			else:
				all -= b
		print(all)

def patrickandshopping():
	d = input().split(' ')
	d3 = 0
	for i in range(len(d)):
		if int(d[i]) > d3:
			d3 = int(d[i])
	d.pop(d.index(str(d3)))
	d1 = int(d[0])
	d2 = int(d[1])
	distance = d1 + d2
	if d3 <= distance:
		distance += d3
	else:
		distance += distance
	print(distance)

def Freeicecream():
	nx = input().split(' ')
	n = int(nx[0])
	ice = int(nx[1])
	diskid = 0
	for i in range(n):
		k = input().split(' ')
		if k[0] == '+':
			ice += int(k[1])
		elif ice >= int(k[1]):
			ice -= int(k[1])
		else:
			diskid += 1
	print(ice, diskid)

def Reviewsite():
	t = int(input())
	for i in range(t):
		n = int(input())
		upvotes = 0
		votes = input().split(' ')
		for i in votes:
			if i != '2':
				upvotes += 1
		print(upvotes)

def Lastyeasrtssubstring():
	t = int(input())
	for i in range(t):
		n = int(input())
		s = input()
		if s[0:4] == '2020' or s[n - 4:n] == '2020':
			print('YES')
		elif s[0:3] == '202' and s[n - 1] == '0':
			print('YES')
		elif s[n - 3:n] == '020' and s[0] == '2':
			print('YES')
		elif s[0:2] == '20' and s[n - 2] == '20':
			print('YES')
		elif s[n - 2:n] == '20' and s[0:2] == '20':
			print('YES')
		else:
			print('NO')

def Arena():
	t = int(input())
	for i in range(t):
		n = int(input())
		heros = input().split(' ')
		heorsint = [int(i) for i in heros]
		heorsint.sort()
		min = heorsint[0]
		winner = n - heorsint.count(min)
		print(winner)

def twoRabbitstoolongbutright():
	t = int(input())
	for i in range(t):
		xyab = input().split(' ')
		x = int(xyab[0])
		y = int(xyab[1])
		a = int(xyab[2])
		b = int(xyab[3])
		seconds = 0
		while x < y:
			x += a
			y -= b
			seconds += 1
		if x == y:
			print(seconds)
		else:
			print(-1)

def systemofequations():
	nm = input().split(' ')
	n = int(nm[0])
	m = int(nm[1])
	nm = [int(i) for i in nm]
	nm.sort()
	count = 0
	for i in range(nm[0] + 1):
		for j in range(nm[0] + 1):
			if i ** 2 + j == n and j ** 2 + i == m:
				count += 1
	print(count)

def polycarpwspockets():
	n = int(input())
	coins = input().split(' ')
	coins = [int(i) for i in coins]
	pocket = 0
	for i in coins:
		nmumbver = coins.count(i)
		if nmumbver > pocket:
			pocket = nmumbver
	print(pocket)

def repeaqtijgcipher():
	n = int(input())
	s = input()
	counter = 0
	rep = 1
	ns = ''
	while counter < n:
		counter += rep
		ns += s[counter - 1]
		rep += 1
	print(ns)

def Neaarestinterestingnumber():
	a = input()
	s = int(a)
	while True:
		if sum((int(i) for i in str(s))) % 4 == 0:
			return print(s)
		else:
			s += 1

def therearetwotzpesofburgers():
	t = int(input())
	for i in range(t):
		ess = input().split(' ')
		ess = [int(i) for i in ess]
		price = input().split(' ')
		buns = int(ess[0])
		totalmoney = 0
		first = True
		if int(price[0]) > int(price[1]):
			patties = ess[1]
			otherpatties = ess[2]
			money = int(price[0])
			othermoney = int(price[1])
		else:
			patties = ess[2]
			otherpatties = ess[1]
			money = int(price[1])
			othermoney = int(price[0])
		keep = True
		while keep:
			if buns - 2 >= 0 and patties - 1 >= 0:
				buns -= 2
				patties -= 1
				totalmoney += money
			elif buns - 2 >= 0 and patties == 0:
				if first:
					patties = otherpatties
					money = othermoney
					first = False
				else:
					print(totalmoney)
					keep = False
			else:
				print(totalmoney)
				keep = False

def threeswimmerstimelimitebutseemsright():
	t = int(input())
	for i in range(t):
		pabc = input().split(' ')
		pabc = [int(i) for i in pabc]
		a = 0
		b = 0
		c = 0
		p = pabc[0]
		keep = True
		while keep:
			if a < p:
				a += pabc[1]
			if b < p:
				b += pabc[2]
			if c < p:
				c += pabc[3]
			if a >= p and b >= p and (c >= p):
				list = [a - p, b - p, c - p]
				list.sort()
				print(list[0])
				keep = False

def Gregsworkout():
	n = int(input())
	training = input().split(' ')
	training = [int(i) for i in training]
	map = [0, 0, 0]
	current = 0
	for i in training:
		map[current] += i
		if current < 2:
			current += 1
		else:
			current = 0
	sorte = []
	for i in map:
		sorte.append(i)
	sorte.sort()
	index = map.index(sorte[2])
	if index == 0:
		print('chest')
	elif index == 1:
		print('biceps')
	else:
		print('back')

def heisttimelimitebutseemsright():
	n = int(input())
	all = input().split(' ')
	all = [int(i) for i in all]
	all.sort()
	counter = 0
	for i in range(all[0], all[len(all) - 1]):
		if i not in all:
			counter += 1
	print(counter)

def nonzero():
	t = int(input())
	for i in range(t):
		n = int(input())
		numbers = input().split(' ')
		count = numbers.count('0')
		for i in range(count):
			ind = numbers.index('0')
			numbers.pop(ind)
			numbers.insert(ind, '1')
		numbers = [int(i) for i in numbers]
		if sum(numbers) == 0:
			count += 1
		print(count)

def distinctdigits():
	lr = input().split(' ')
	for i in range(int(lr[0]), int(lr[1]) + 1):
		couynt = []
		for j in str(i):
			if j not in couynt:
				couynt.append(j)
		if len(couynt) == len(str(i)):
			return print(i)
	else:
		return print(-1)

def dawidandbagsofcandies():
	bags = input().split(' ')
	bags = [int(i) for i in bags]
	bags.sort()
	if bags[0] + bags[3] == bags[1] + bags[2]:
		print('YES')
	elif bags[3] == bags[0] + bags[1] + bags[2]:
		print('YES')
	else:
		print('NO')

def lastminuteenhancements():
	t = int(input())
	for i in range(t):
		n = int(input())
		notes = input().split(' ')
		lists = []
		for i in notes:
			if int(i) not in lists:
				lists.append(int(i))
			elif int(i) + 1 not in lists:
				lists.append(int(i) + 1)
		print(len(lists))

def Cakeminator():
	rc = input().split(' ')
	cake = []
	pices = 0
	rows = 0
	for i in range(int(rc[0])):
		cake.append([i for i in input()])
	for i in range(int(rc[1])):
		count = 0
		for j in range(int(rc[0])):
			if cake[j][i] == '.':
				count += 1
			if count == int(rc[0]):
				pices += count
				rows += 1
	for i in range(int(rc[0])):
		if 'S' not in cake[i]:
			pices += int(rc[1]) - rows
	print(pices)

def CME():
	t = int(input())
	for i in range(t):
		n = int(input())
		four = 4
		while four < n:
			four += 2
		print(four - n)

def FriendsandCandies():
	t = int(input())
	for i in range(t):
		n = int(input())
		cadies = input().split(' ')
		cadies = [int(i) for i in cadies]
		all = sum(cadies) % n
		count = 0
		if all != 0:
			print(-1)
		else:
			for i in cadies:
				if i > sum(cadies) // n:
					count += 1
			print(count)

def tworivalstudents():
	t = int(input())
	for i in range(t):
		nxab = input().split(' ')
		n = int(nxab[0])
		x = int(nxab[1])
		if int(nxab[2]) >= int(nxab[3]):
			bigger = int(nxab[2])
			smaller = int(nxab[3])
		else:
			bigger = int(nxab[3])
			smaller = int(nxab[2])
		for i in range(x):
			if bigger < n:
				bigger += 1
			elif smaller > 1:
				smaller -= 1
			else:
				break
		print(bigger - smaller)

def OmkarandPassword():
	t = int(input())
	for i in range(t):
		n = int(input())
		array = input().split(' ')
		array = [int(i) for i in array]
		pointer = 0
		while array.count(array[0]) != len(array):
			if array[pointer] != array[pointer + 1]:
				array.insert(pointer, array[pointer] + array[pointer + 1])
				array.pop(pointer)
				array.pop(pointer + 1)
			elif pointer + 1 < len(array) - 1:
				pointer += 1
			else:
				pointer = 0
		print(len(array))

def tanyaasndstairways():
	n = int(input())
	k = input().split(' ')
	k = [int(i) for i in k]
	last = []
	storeys = k.count(1)
	for i in range(n - 1):
		if k[i] >= k[i + 1]:
			last.append(k[i])
	last.append(k[n - 1])
	print(storeys)
	printable = ''
	for i in last:
		printable += str(i) + ' '
	print(printable)

def adjacentreplacements():
	t = int(input())
	wowowo = input()
	wo = wowowo.split(' ')
	wo = [int(i) for i in wo]
	for i in range(t):
		if wo[i] % 2 == 0:
			wo[i] -= 1
	s = ''
	for i in wo:
		s += str(i) + ' '
	print(s)

def Divideit():
	t = int(input())
	for i in range(t):
		n = int(input())
		counter = 0
		while n > 1:
			if n % 2 == 0:
				n = n // 2
				counter += 1
			elif n % 3 == 0:
				n = 2 * n // 3
				counter += 1
			elif n % 5 == 0:
				n = 4 * n // 5
				counter += 1
			else:
				counter = -1
				break
		print(counter)

def DiverseTeam():
	nk = input().split(' ')
	n = int(nk[0])
	k = int(nk[1])
	rating = input().split(' ')
	list = []
	s = ''
	for i in range(n):
		if rating[i] not in list:
			list.append(rating[i])
			s += str(i + 1) + ' '
		if len(list) == k:
			print('YES')
			return print(s)
	return print('NO')

def phoenixandgold():
	t = int(input())
	for i in range(t):
		nx = input().split(' ')
		n = int(nx[0])
		x = int(nx[1])
		gold = input().split(' ')
		gold = [int(i) for i in gold]
		count = 0
		s = ''
		if sum(gold) == x:
			print('NO')
		else:
			while len(gold) != 0:
				for i in range(len(gold)):
					if i < len(gold):
						if gold[i] + count != x:
							count += gold[i]
							s += str(gold[i]) + ' '
							gold.pop(i)
			print('YES')
			print(s)

def ingamechat():
	t = int(input())
	for i in range(t):
		n = int(input())
		s = input()
		c = 0
		for i in s:
			if i == ')':
				c += 1
			else:
				c = 0
		if c > n - c:
			print('Yes')
		else:
			print('No')

def IntegerSAequencedividing():
	list = [int(i) for i in range(1, int(input()) + 1)]
	list.reverse()
	A = 0
	B = 0
	while len(list) > 0:
		if len(list) != 1:
			one = list[0]
			two = list[1]
			list.pop(0)
			list.pop(0)
		else:
			one = list[0]
			list.pop(0)
			two = 0
		if abs(A + one - (B + two) <= abs(B + one - (A + two))):
			A += one
			B += two
		else:
			A += two
			B += one
	print(abs(A - B))

def shortestpathwithobstacle():
	t = int(input())
	for i in range(t):
		s = input()
		A = [int(i) for i in input().split(' ')]
		B = [int(i) for i in input().split(' ')]
		F = [int(i) for i in input().split(' ')]
		distance = abs(A[0] - B[0]) + abs(A[1] - B[1])
		if A[0] == B[0] and A[0] == F[0] and (min(A[1], B[1]) < F[1]) and (F[1] < max(A[1], B[1])) or (A[1] == B[1] and A[1] == F[1] and (min(A[0], B[0]) < F[0]) and (F[0] < max(A[0], B[0]))):
			distance += 2
		print(distance)

def Removeduplicates():
	t = int(input())
	numbers = input().split(' ')
	numbers.reverse()
	removed = []
	for i in numbers:
		if i not in removed:
			removed.append(i)
	removed.reverse()
	s = ''
	for i in removed:
		s += i + ' '
	print(len(removed))
	print(s)

def Threestrings():
	t = int(input())
	for i in range(t):
		a = input()
		b = input()
		c = input()
		work = True
		for i in range(len(a)):
			if a[i] != c[i] and b[i] != c[i]:
				work = False
		if work:
			print('YES')
		else:
			print('NO')

def specifictastesofandre():
	t = int(input())
	for i in range(t):
		li = [1 for i in range(int(input()))]
		s = ''
		for i in li:
			s += str(i) + ' '
		print(s)

def dejavu():
	t = int(input())
	for i in range(t):
		s = input()
		if s + 'a' == 'a' + s:
			print('NO')
		else:
			sl = list(s + 'a')
			rsl = []
			for i in sl:
				rsl.insert(0, i)
			if sl != rsl:
				print('YES')
				print(s + 'a')
			else:
				print('YES')
				print('a' + s)

def buythestring():
	t = int(input())
	for i in range(t):
		ncch = [int(i) for i in input().split(' ')]
		s = input()
		money = 0
		for i in s:
			if i == '0':
				money += min(ncch[1], ncch[2] + ncch[3])
			else:
				money += min(ncch[2], ncch[1] + ncch[3])
		print(money)

def Keyraces():
	svvtt = [int(i) for i in input().split(' ')]
	first = 2 * svvtt[3] + svvtt[0] * svvtt[1]
	scond = 2 * svvtt[4] + svvtt[0] * svvtt[2]
	if first > scond:
		print('Second')
	elif first < scond:
		print('First')
	else:
		print('Friendship')

def Angrystudents():
	t = int(input())
	for i in range(t):
		len = int(input())
		s = list(input())
		counter = 0
		counterlist = [0]
		if s.count('A') != 0:
			firstp = s.index('A')
			for i in range(firstp, len):
				if s[i] == 'P':
					counter += 1
				else:
					counterlist.append(counter)
					counter = 0
			counterlist.append(counter)
		print(max(counterlist))

def Frence():
	t = int(input())
	for i in range(t):
		d = sum([int(i) for i in input().split(' ')]) - 1
		print(d)

def playongwhithdice():
	ab = [int(i) for i in input().split(' ')]
	a = ab[0]
	b = ab[1]
	awins = 0
	draw = 0
	bwins = 0
	for i in range(1, 7):
		if abs(i - a) < abs(i - b):
			awins += 1
		elif abs(i - a) > abs(i - b):
			bwins += 1
		else:
			draw += 1
	print(awins, draw, bwins)

def arrayandpeaks():
	t = int(input())
	for i in range(t):
		(n, k) = [int(i) for i in input().split(' ')]
		listaa = [i for i in range(1, n - k + 1)]
		listoo = [i for i in range(n - k + 1, n + 1)]
		s = ''
		if len(listaa) > len(listoo):
			for i in range(len(listaa)):
				s += str(listaa[0]) + ' '
				listaa.pop(0)
				if len(listoo) != 0:
					s += str(listoo[0]) + ' '
					listoo.pop(0)
		else:
			s = '-1'
		print(s)

def mishkaandContest():
	(n, k) = [int(i) for i in input().split()]
	problems = [int(i) for i in input().split()]
	fp = 0
	sp = 0
	first = True
	for i in problems:
		if i <= k and first:
			fp += 1
		elif i > k and first:
			first = False
		elif i <= k and (not first):
			sp += 1
		else:
			sp = 0
	print(sp + fp)
mishkaandContest()


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
(l, r) = (0, 0)
s = set()
for i in range(n):
	if a[i] <= k:
		s.add(i)
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		s.add(i)
	else:
		break
print(len(s))


inp = lambda : map(int, input().split())
(n, k) = inp()
a = list(inp())
left = 0
right = 0
for i in range(n):
	if a[i] > k:
		break
	else:
		left += 1
for i in range(n - 1, -1, -1):
	if a[i] > k:
		break
	else:
		right += 1
print(min(n, left + right))


t = list(map(int, input().split()))
l = list(map(int, input().split()))
cou = 0
w = 0
while True:
	w = w + 1
	if l[0] <= t[1]:
		l.pop(0)
		cou += 1
		if w >= t[0]:
			break
		continue
	elif l[-1] <= t[1]:
		l.pop()
		cou += 1
		if w >= t[0]:
			break
		continue
	else:
		break
print(cou)


import time
(n, k) = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
start = time.time()
if max(a) <= k:
	print(n)
else:
	for i in range(n):
		if a[i] > k:
			break
	j = n - 1
	for j in range(n - 1, -1, -1):
		if a[j] > k:
			break
	print(i + n - j - 1)
finish = time.time()


(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
l = str(n)
l = int(l)
for i in a:
	if i <= k:
		l -= 1
	else:
		break
if l != 0:
	for i in a[::-1]:
		if i <= k:
			l -= 1
		else:
			break
print(n - l)


from sys import exit
(n, k) = map(int, input().split())
pdl = [int(x) for x in input().split()]
c = 0
for pd in pdl:
	if k < pd:
		break
	c += 1
else:
	print(c)
	exit(0)
pdl.reverse()
for pd in pdl:
	if k < pd:
		break
	c += 1
print(c)


import sys

def GetProblemSoloved(a, k):
	i = 0
	l = len(a) - 1
	k = int(k)
	count = 0
	for diff in a:
		if diff <= k:
			count += 1
		else:
			break
	C = count
	for i in range(len(a) - 1, C, -1):
		if a[i] <= k:
			count += 1
		else:
			break
	return count
i = 0
a = []
n = 0
k = 0
(n, k) = input().split()
n = int(n)
k = int(k)
a = input().split()
for c in range(len(a)):
	a[c] = int(a[c])
r = GetProblemSoloved(a, k)
print(r)


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
d = 0
for i in range(len(c)):
	if c[0] <= b:
		del c[0]
		d += 1
	elif c[-1] <= b:
		del c[-1]
		d += 1
	else:
		break
print(d)


(m, n) = [int(i) for i in input().split()]
mas = []
mas = [int(i) for i in input().split()]
k = 0
while mas[0] <= n:
	if len(mas) == 1:
		k += 1
		break
	else:
		mas.pop(0)
		k += 1
while mas[-1] <= n:
	if len(mas) == 1:
		break
	else:
		mas.pop(-1)
		k += 1
print(k)


l1 = [int(i) for i in input().split(' ')]
l2 = [int(i) for i in input().split(' ')]
a = 0
b = 0
for i in range(l1[0]):
	if l2[i] <= l1[1]:
		a += 1
		b = i
	else:
		break
for i in range(l1[0] - 1, b, -1):
	if l2[i] <= l1[1]:
		a += 1
	else:
		break
print(a)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
p = 0
flag = 0
l = []
for i in range(len(a)):
	if a[i] <= k:
		p += 1
	elif a[i] > k:
		a.reverse()
		for j in range(len(a)):
			if a[j] <= k:
				p += 1
			else:
				flag = 1
				break
	if flag == 1:
		break
print(p)


def mishkaAndContest(arr1, arr2):
	k = arr1[1]
	n = arr1[0] - 1
	ini = 0
	sum = 0
	while ini <= n:
		if arr2[ini] <= k:
			sum = sum + 1
			ini = ini + 1
		elif arr2[n] <= k:
			sum = sum + 1
			n = n - 1
		else:
			break
	return sum

def main():
	arr1 = [int(c) for c in input().split()]
	arr2 = [int(c) for c in input().split()]
	print(mishkaAndContest(arr1, arr2))
main()


(n, k) = map(int, input().split())
A = list(map(int, input().split()))
left = 0
while left < n and A[left] <= k:
	left += 1
for right in range(n - left):
	if A[-right - 1] > k:
		print(left + right)
		break
else:
	print(n)


(n, k) = (int(x) for x in input().split())
arr = [int(x) for x in input().split()]
unable = [i for i in range(len(arr)) if arr[i] > k]
if len(unable) == 0:
	print(n)
else:
	print(n - (max(unable) - min(unable) + 1))


(n, k) = map(int, input().strip().split())
arr = list(map(int, input().strip().split()))
count = 0
countleft = 0
countright = 0
for i in range(len(arr)):
	if arr[i] <= k:
		countleft += 1
	else:
		break
for i in range(len(arr)):
	if arr[n - 1 - i] <= k:
		countright += 1
	else:
		break
count += countleft + countright
if count == 2 * len(arr):
	print(int(count / 2))
else:
	print(count)


(a, b) = map(int, input().split())
s = input()
n = [int(s) for s in s.split()]
u = 0
t = 0
for i in range(a):
	t = len(n) - 1
	if n[0] <= b and n[t] > b:
		n.pop(0)
		u += 1
	elif n[0] > b and n[t] <= b:
		n.pop(t)
		u += 1
	elif n[0] <= b and n[t] <= b:
		n.pop(0)
		u += 1
print(u)


(n, k) = [int(i) for i in input().split()]
p = []
a = [int(i) for i in input().split()]
for i in range(n):
	if a[i] > k:
		p.append(i + 1)
if len(p) > 0:
	print(p[0] - 1 + n - p[-1])
else:
	print(n)


A = [int(i) for i in input().split()]
n = A[0]
k = A[1]
B = [int(i) for i in input().split()]
l = 0
r = 0
for i in range(len(B)):
	if B[i] <= k:
		l += 1
	else:
		break
for i in range(len(B)):
	if B[len(B) - 1 - i] <= k:
		l += 1
	else:
		break
print(min(l + r, n))


(n, k) = map(int, input().split())
mas = list(map(int, input().split()))
s = len(mas)
while True:
	if mas[0] > k and mas[len(mas) - 1] > k:
		break
	if mas[0] <= k:
		mas.pop(0)
	if len(mas) == 0:
		break
	if mas[len(mas) - 1] <= k:
		mas.pop()
	if len(mas) == 0:
		break
print(s - len(mas))


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
uttor = 0
while True:
	if uttor == n:
		break
	if a[0] <= m:
		uttor += 1
		del a[0]
	elif a[-1] <= m:
		uttor += 1
		del a[-1]
	else:
		break
print(uttor)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
p1 = 0
p2 = n - 1
r = 0
if n == 1 and k >= a[0]:
	print(1)
else:
	while p1 <= p2:
		if a[p1] <= k:
			p1 += 1
			r += 1
		elif a[p2] <= k:
			r += 1
			p2 -= 1
		else:
			break
	print(r)


a = input().split()
b = input().split()
n = int(a[0])
k = int(a[1])
count = 0
for i in range(n):
	b[i] = int(b[i])
for j in range(n):
	if k >= b[0]:
		del b[0]
		count = count + 1
	elif k >= b[-1]:
		del b[-1]
		count = count + 1
print(count)


n_k = input().split(' ')
n = int(n_k[0])
k = int(n_k[1])
count = 0
ques = input().split(' ')
ques = [int(ques[i]) for i in range(n)]
while ques:
	if ques[0] <= k:
		del ques[0]
		count += 1
	elif ques[-1] <= k:
		del ques[-1]
		count += 1
	else:
		break
print(count)


n = list(map(int, input().split()))
z = list(map(int, input().split()))
count = 0
step = 0
while step < len(z) + count:
	if z[0] <= n[1]:
		count += 1
		del z[0]
		step += 1
	else:
		break
step = 0
counti = 0
while step < len(z) + counti:
	if z[-1] <= n[1]:
		counti += 1
		del z[-1]
		step += 1
	else:
		break
print(count + counti)


(n, k) = [int(x) for x in input().strip().split()]
a = [int(x) for x in input().strip().split()]
i = 0
j = len(a) - 1
cnt = 0
while i <= j and a[i] <= k:
	i += 1
	cnt += 1
while i <= j and a[j] <= k:
	j -= 1
	cnt += 1
print(cnt)


def main():
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	l = 0
	r = n - 1
	c = 0
	while (a[l] <= k or a[r] <= k) and l <= r:
		if a[l] <= k:
			l += 1
		elif a[r] <= k:
			r -= 1
		c += 1
		if l > r:
			break
	print(c)
main()


(n, m) = map(int, input().split())
l = [int(i) for i in input().split()]
k = 0
j = n - 1
for i in range(n):
	if l[i] > m:
		j = i
		break
	k += 1
for i in range(n):
	if l[n - 1 - i] > m or n - 1 - i <= j:
		break
	k += 1
print(k)


(n, k) = [int(x) for x in input().split()]
str1 = [int(x) for x in input().split()]
count = 0
temp = len(str1) - 1
for i in range(0, len(str1)):
	if str1[i] <= k:
		count = count + 1
	else:
		temp = i
		break
pro = len(str1) - 1 - temp
for i in range(len(str1) - 1, temp, -1):
	if str1[i] <= k:
		count = count + 1
	else:
		break
print(count)


(n, k) = map(int, input().strip().split())
v = list(map(int, input().strip().split()))
l = 0
c = 0
r = n - 1
while l <= r and (v[r] <= k or v[l] <= k):
	if v[l] <= k:
		c += 1
		l += 1
	if l <= r and v[r] <= k:
		c += 1
		r -= 1
print(c)


n = input().split()
k = int(n[1])
n = int(n[0])
a = [int(i) for i in input().split()]
q = 0
while k >= a[0]:
	del a[0]
	q += 1
	if len(a) == 0:
		break
if len(a) != 0:
	while k >= a[-1]:
		del a[-1]
		q += 1
		if len(a) == 0:
			break
print(q)


(n, k) = map(int, input().split())
guizes = list(map(int, input().split()))
resalt = 0
try:
	while guizes[0] <= k:
		resalt += 1
		guizes.pop(0)
	while guizes[-1] <= k:
		resalt += 1
		guizes.pop(-1)
except:
	pass
print(resalt)


(n, k) = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
i = 0
cnt = 0
while i < n and a[i] <= k:
	cnt += 1
	i += 1
i = -1
while i * -1 < n + 1 and a[i] <= k:
	cnt += 1
	i -= 1
if cnt > n:
	cnt = n
print(cnt)


import math
getInputList = lambda : list(input().split())
getInputIntList = lambda : list(map(int, input().split()))
(n, k) = getInputIntList()
arr = getInputIntList()
count = 0
for i in arr:
	if i > k:
		break
	count += 1
if count != n:
	for i in range(len(arr) - 1, -1, -1):
		if arr[i] > k:
			break
		count += 1
print(count)


(temp, n) = map(int, input().split())
a = list(map(int, input().split()))
result = 0
while len(a) > 0:
	if a[0] <= n:
		result += 1
		a = a[1:]
	else:
		break
while len(a) > 0:
	if a[-1] <= n:
		result += 1
		a = a[:-1]
	else:
		break
print(result)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(n, k) = LI()
	a = LI()
	t = max(a)
	if t <= k:
		return len(a)
	r = 0
	for c in a:
		if c > k:
			break
		r += 1
	for c in a[::-1]:
		if c > k:
			break
		r += 1
	return r
print(main())


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
front = 0
back = n - 1
number = 0
while front <= back:
	j = min(a[front], a[back])
	if j > k:
		break
	if j == a[front] and j == a[back] and (front != back):
		front += 1
		number += 2
		back -= 1
	elif j == a[front]:
		front += 1
		number += 1
	else:
		back -= 1
		number += 1
print(number)


import sys, math, collections
from collections import defaultdict

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w')

def get_array():
	l = list(map(int, input().split()))
	return l

def get_2_ints():
	(a, b) = map(int, input().split())
	return (a, b)

def get_3_ints():
	(a, b, c) = map(int, input().split())
	return (a, b, c)

def sod(n):
	(n, c) = (str(n), 0)
	for i in n:
		c += int(i)
	return c

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	floor = -1
	while left <= right:
		mid = (left + right) // 2
		if A[mid] == x:
			return A[mid]
		elif x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			left = mid + 1
	return floor

def floorSqrt(x):
	if x == 0 or x == 1:
		return x
	start = 1
	end = x
	while start <= end:
		mid = (start + end) // 2
		if mid * mid == x:
			return mid
		if mid * mid < x:
			start = mid + 1
			ans = mid
		else:
			end = mid - 1
	return ans

def main():
	(n, m) = get_2_ints()
	l = get_array()
	c = 0
	for i in range(n):
		if l[i] <= m:
			l[i] = 'h'
			c += 1
		else:
			break
	l.reverse()
	for i in range(n):
		if l[i] == 'h':
			break
		elif l[i] <= m:
			c += 1
		else:
			break
	print(c)
main()


(n, k) = map(int, input().split())
ps = list(map(int, input().split()))
count = 0
for i in range(n):
	if k < min(ps[0], ps[-1]):
		break
	else:
		count += 1
		if ps[0] <= ps[-1]:
			ps.pop(0)
		else:
			ps.pop(-1)
print(count)


def solve(n, k, a):
	while a[0] <= k and a != []:
		a = a[1:]
		if a == []:
			break
	if a != []:
		while a[-1] <= k and a != []:
			a = a[:-1]
	return n - len(a)
(n, k) = map(int, input().split())
numbers = list(map(int, input().strip().split()))
print(solve(n, k, numbers))


(n, k) = list(map(int, input().split()))
h = list(map(int, input().split()))
ans = 0
for i in range(n):
	if h[0] <= k:
		ans += 1
		del h[0]
	else:
		break
n = len(h)
for i in range(n):
	if h[-1] <= k:
		ans += 1
		del h[-1]
	else:
		break
print(ans)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] > k:
		break
	a[i] = -1
for i in range(n - 1, -1, -1):
	if a[i] > k or a[i] == -1:
		break
	a[i] = -1
print(a.count(-1))


def gogo(n, k, t):
	i = 0
	j = n - 1
	count = 0
	while True:
		if t[i] > k and t[j] > k or i == j:
			if t[i] <= k:
				count += 1
			break
		if t[i] <= k:
			count += 1
			i += 1
		elif t[j] <= k:
			count += 1
			j -= 1
	return count

def main():
	(n, k) = map(int, input().split())
	t = list(map(int, input().split()))
	print(gogo(n, k, t))
main()


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
l = a[0]
r = a[-1]
c = 0
m = 0
for i in range(n):
	if l <= k:
		c = c + 1
		if i < n - 1:
			l = a[i + 1]
		if i == n - 1:
			l = [n - 1]
	else:
		m = m + 1
		if r <= k:
			c = c + 1
			r = a[-(m + 1)]
		else:
			print(c)
			break
else:
	print(n)


(n, k) = map(int, input().split())
difficulties = list(map(int, input().split()))
solved = True
count = 0
left = 0
right = n - 1
while solved and left <= right:
	solved = False
	if difficulties[left] <= k:
		left += 1
		solved = True
		count += 1
	elif difficulties[right] <= k:
		right -= 1
		solved = True
		count += 1
print(count)


a = [int(i) for i in input().split(' ')]
n = a[0]
k = a[1]
s = [int(i) for i in input().split(' ')]
ctr = 0
if k >= max(s):
	print(n)
else:
	for i in s:
		if i <= k:
			ctr += 1
		else:
			break
	for i in reversed(s):
		if i <= k:
			ctr += 1
		else:
			break
	print(ctr)


input1 = input()
inputL = input1.split(' ')
n = int(inputL[0])
k = int(inputL[1])
input2 = input()
num_problems = 0
problemsL = input2.split(' ')
if n != 0:
	while True:
		if problemsL == []:
			break
		if k >= int(problemsL[0]):
			num_problems += 1
			del problemsL[0]
		else:
			break
	while True:
		if problemsL == []:
			break
		if k >= int(problemsL[-1]):
			num_problems += 1
			del problemsL[-1]
		else:
			break
	print(num_problems)
else:
	print('0')


def count(i, max, index):
	return (max, index)
(n, k) = [int(x) for x in input().split()]
ps = [int(x) for x in input().split()]
count = 0
for p in ps:
	if p <= k:
		count += 1
	else:
		break
j = n - 1
while j >= 0:
	if ps[j] <= k:
		count += 1
	else:
		break
	j -= 1
if count == 2 * n:
	print(n)
else:
	print(count)


def Miksha():
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	t = 0
	if max(a) <= k:
		print(n)
		return
	else:
		for i in range(n):
			if a[i] <= k:
				t += 1
			else:
				break
		for j in range(n - 1, -1, -1):
			if a[j] <= k:
				t += 1
			else:
				break
	print(t)
Miksha()


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
t = []
for i in range(len(l)):
	if l[i] > k:
		t.append(i)
if len(t) == 0:
	print(len(l))
elif len(t) == 1:
	print(len(l) - 1)
else:
	low = t[0]
	high = t[len(t) - 1]
	print(low + (len(l) - high - 1))


a = input().split(' ')
k = int(a[1])
b = input().split(' ')
p = list(map(int, b))
x = 0
y = int(a[0]) - 1

def calcX():
	global x
	xflag = 0
	while True:
		if p[x] > k:
			break
		else:
			if x == y:
				x = x + 1
				xflag = 1
				break
			x = x + 1
	return xflag

def calcY():
	global y
	while True:
		if p[y] > k:
			break
		else:
			if y == x:
				break
			y = y - 1
while True:
	flag = calcX()
	if flag:
		break
	calcY()
	break
totalNumber = x + int(a[0]) - y - 1
print(totalNumber)


import sys
(n, k) = map(int, sys.stdin.readline().split(' '))
a = list(map(int, sys.stdin.readline().split(' ')))

def do():
	i = 0
	while i < n and a[i] <= k:
		i += 1
	if i == n:
		return i
	j = n - 1
	while j >= 0 and a[j] <= k:
		j -= 1
	return i + (n - 1 - j)
print(do())


(n, m) = map(int, input().split())
lst = list(map(int, input().split()))
for i in range(n):
	if lst[i] <= m and lst[i] != -1:
		lst[i] = -1
	else:
		break
rlst = list(reversed(lst))
for i in range(n):
	if rlst[i] <= m and rlst[i] != -1:
		rlst[i] = -1
	else:
		break
c = 0
for i in range(n):
	if rlst[i] == -1:
		c += 1
print(c)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
ans = 0
while len(a) > 0 and a[0] <= k:
	ans += 1
	a = a[1:]
while len(a) > 0 and a[-1] <= k:
	ans += 1
	a = a[:-1]
print(ans)


(n, k) = input().split()
n = int(n)
k = int(k)
a = list(map(int, input().split()))
(q, i, z) = (0, 0, n - 1)
while i <= n - 1 and a[i] <= k:
	q += 1
	i += 1
while z >= 0 and a[z] <= k:
	q += 1
	z -= 1
if q > n:
	q = n
print(q)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
ind1 = -1
ind2 = 0
for i in range(n):
	if a[i] > k:
		if ind1 == -1:
			ind1 = i
		ind2 = i
if ind1 == -1:
	print(n)
else:
	print(min(n, n - (ind2 - ind1 + 1)))


(n, k) = [int(i) for i in input().split()]
lst = list(map(int, input().split()))
(i, j) = (0, n - 1)
c = 0
while (lst[i] <= k or lst[j] <= k) and i <= j:
	if i < j and lst[i] <= k:
		c += 1
		i += 1
	if i < j and lst[j] <= k:
		c += 1
		j -= 1
	if i == j and lst[i] <= k:
		c += 1
		break
print(c)


(a, b) = map(int, input().split())
lst = [int(i) for i in input().split()]
sum = 0
sum1 = 0
for k in range(len(lst)):
	if lst[k] <= b:
		sum = sum + 1
	else:
		break
lst.reverse()
for j in range(len(lst)):
	if lst[j] <= b:
		sum1 = sum1 + 1
	else:
		break
s = sum1 + sum
print(min(a, s))


def main():
	(n, k) = [int(i) for i in input().split(' ')]
	p = [int(i) for i in input().split(' ')]
	l = 0
	ans = 0
	for i in range(n):
		if p[i] <= k:
			l = i
			ans += 1
		else:
			break
	for i in range(n - 1, l, -1):
		if p[i] <= k:
			ans += 1
		else:
			break
	print(ans)
main()


(a, b) = map(int, input().split())
l = [int(i) for i in input().split()]
c = 0
while len(l) > 0:
	premier = l[0]
	last = l[-1]
	if premier <= b:
		c += 1
		del l[0]
	elif last <= b:
		c += 1
		del l[-1]
	else:
		break
print(c)


(n, k) = map(int, input().split())
problems = list(map(int, input().split()))
count = 0
for i in range(n - 1, -1, -1):
	if problems[i] <= k:
		problems[i] = 0
		count += 1
	else:
		break
for p in problems:
	if p <= k and p != 0:
		count += 1
	else:
		break
print(count)


import sys
import math
(n, k) = map(int, input().split())
lista = [int(x) for x in input().strip().split()]
conta = 0
visited = [0 for i in range(n)]
for i in range(n):
	if lista[i] <= k:
		conta += 1
		visited[i] = 1
	else:
		break
for i in range(n - 1, -1, -1):
	if lista[i] <= k and visited[i] == 0:
		conta += 1
	else:
		break
print(conta)


(n, k) = list(map(int, input().split()))
pb = list(map(int, input().split()))
visited = [False] * n
count = 0
start = 0
end = n - 1
while True:
	if start < n and pb[start] <= k and (visited[start] == False):
		visited[start] = True
		count += 1
		start += 1
	else:
		break
while True:
	if end >= 0 and pb[end] <= k and (visited[end] == False):
		visited[end] = True
		count += 1
		end -= 1
	else:
		break
print(count)


(n, k) = [int(i) for i in input().split()]
sp = [int(i) for i in input().split()]
tiller = 0
Flag = True
while sp != []:
	if sp[0] <= k:
		sp.pop(0)
		tiller += 1
	elif sp[-1] <= k:
		sp.pop(-1)
		tiller += 1
	else:
		print(tiller)
		break
if sp == []:
	print(n)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0
if k >= max(a):
	print(n)
else:
	for i in range(n):
		if int(a[i]) > int(k):
			z = i
			break
	for j in range(n - 1, -1, -1):
		if int(a[j]) > int(k):
			l = j
			break
	print(z + (n - 1 - l))


(N, K) = map(int, input().split())
A = [int(i) for i in input().split()]
L = -1
R = -1
for i in range(N):
	if A[i] > K:
		L = i
		break
if L == -1:
	print(N)
	exit()
for i in range(N):
	if A[::-1][i] > K:
		R = i
		break
print(L + R)


(number, skill) = input().split()
number = int(number)
skill = int(skill)
problems = list(map(int, input().split()))
stop_at = 0
checked = 0
index = 0
solved = 0
for index in range(len(problems)):
	if number == checked:
		break
	elif skill >= problems[index]:
		solved = solved + 1
		checked = checked + 1
	else:
		stop_at = index
		break
for i in range(len(problems) - 1, -1, -1):
	if number == checked:
		break
	elif i == stop_at:
		break
	elif skill >= problems[i]:
		solved = solved + 1
		checked = checked + 1
	else:
		break
print(solved)


(x, y) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
count1 = 0
for i in a:
	if y >= i:
		count = count + 1
	else:
		break
b = a[::-1]
for k in b:
	if y >= k:
		count1 = count1 + 1
	else:
		break
total = count + count1
if total > x:
	print(x)
else:
	print(total)


import collections
from functools import cmp_to_key
import math
import sys

def getIntList():
	return list(map(int, input().split()))
import bisect
try:
	import debug
	dprint = print
	dprint('debug mode')
except ModuleNotFoundError:

	def dprint(*args, **kwargs):
		pass

def makePair(z):
	return [(z[i], z[i + 1]) for i in range(0, len(z), 2)]
dprint(1)
(N, K) = getIntList()
za = getIntList()
s = 0
for x in za:
	if x <= K:
		s += 1
	else:
		break
za.reverse()
for x in za:
	if x <= K:
		s += 1
	else:
		break
if s > N:
	s = N
print(s)


def solve(n, k, a):
	s = 0
	for i in range(n):
		if a[0] <= k:
			s += 1
			a.pop(0)
		elif a[-1] <= k:
			s += 1
			a.pop(-1)
	return s

def main():
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	print(solve(n, k, a))
main()


(n, k) = map(int, input().split())
nums = list(map(int, input().split()))
count = 0
for (i, num) in enumerate(nums):
	if num <= k:
		count += 1
		nums[i] = k + 1
	else:
		break
for num in nums[::-1]:
	if num <= k:
		count += 1
	else:
		break
print(count)


(n, k) = (int(x) for x in input().split())
a = [int(x) for x in input().split()]
begin = -1
end = -2
for i in range(n):
	if a[i] > k:
		if begin == -1:
			begin = i
		end = i
print(n - max(end - begin + 1, 0))


(n, k) = [int(z) for z in input().split()]
a = [int(j) for j in input().split()]
q = 0
counter = 0
while a[q] <= k:
	counter += 1
	if q >= n - 1:
		break
	q += 1
q = n - 1
while a[q] <= k:
	counter += 1
	q -= 1
	if q <= 0:
		break
if counter >= n:
	print(n)
else:
	print(counter)


def gen(a, k):
	for i in a:
		if i <= k:
			yield k
		else:
			return
F = lambda : map(int, input().split())
(n, k) = F()
a = list(F())
print(len([i for i in gen(a, k)]) + (len([i for i in gen(a[::-1], k)]) if any((t > k for t in a)) else 0))


(n, k) = map(int, input().split())
problems = tuple(map(int, input().split()))
i = 0
ans = 0
while i < n:
	if problems[i] <= k:
		ans += 1
	else:
		break
	i += 1
j = n - 1
while j > i:
	if problems[j] <= k:
		ans += 1
	else:
		break
	j -= 1
print(ans)


(n, k) = map(int, input().split())
a = [int(num) for num in input().split()]
c = 0
for i in range(n):
	if a[i] <= k:
		c = c + 1
	else:
		break
a.reverse()
for i in range(n):
	if a[i] <= k:
		c = c + 1
	else:
		break
print(min(n, c))


(n, k) = map(int, input().split())
ls = list(map(int, input().split()))
i1 = -1
i2 = -2
ans = 0
for i in ls:
	if i > k:
		break
	else:
		ans += 1
for i in range(n):
	if ans == n:
		break
	elif ls[n - 1 - i] > k:
		break
	else:
		ans += 1
print(ans)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
while len(a) > 1 and min(a[0], a[-1]) <= k:
	if a[-1] <= k:
		a.pop()
	else:
		del a[0]
	s += 1
if len(a) == 1:
	if a[0] <= k:
		s += 1
print(s)


(n, k) = map(int, input().split())
problem = [int(x) for x in input().split()]
count = 0
for x in problem:
	if x <= k:
		count += 1
	else:
		break
for y in range(-1, -(len(problem) + 1), -1):
	if problem[y] <= k:
		count += 1
	else:
		break
if count > n:
	print(int(count / 2))
else:
	print(count)


a = input()
b = a.split(' ')
n = int(b[0])
k = int(b[1])
a = input()
b = a.split()
i = 0
while (i < n - 1) & (int(b[i]) <= k):
	i = i + 1
j = n - 1
while (j >= 0) & (int(b[j]) <= k):
	j = j - 1
num = n - j + i - 1
if num > n:
	print(n)
else:
	print(num)


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


(a, k) = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
i = 0
while i < a and c[i] <= k:
	i += 1
j = 1
while a - j > i and c[-j] <= k:
	j += 1
print(i + j - 1)


import sys
from math import sqrt, floor, factorial
from collections import deque, Counter
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def solve():
	(n, k) = read()
	arr = read()
	s = 0
	for i in range(n):
		if arr[i] <= k:
			s += 1
		else:
			break
	for j in range(-1, -(n - i), -1):
		if arr[j] <= k:
			s += 1
		else:
			break
	print(s)
solve()


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
left_cnt = 0
for i in range(n):
	if a[i] <= k:
		left_cnt += 1
	else:
		break
right_cnt = 0
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		right_cnt += 1
	else:
		break
if right_cnt + left_cnt > n:
	print(n)
else:
	print(right_cnt + left_cnt)


(n, m) = list(map(int, input().split()))
p = list(map(int, input().split()))
count = 0
for i in range(n):
	if p[i] > m:
		break
	elif p[i] <= m:
		count += 1
if count == n:
	print(count)
elif count != n:
	for j in range(n - 1, -1, -1):
		if p[j] > m:
			break
		elif p[j] <= m:
			count += 1
	print(count)


(n, k) = map(int, input().split())
ar = list(map(int, input().split()))
findL = -1
findR = -1
for i in range(len(ar)):
	if ar[i] > k and findL == -1:
		findL = i
	if ar[n - 1 - i] > k and findR == -1:
		findR = n - i - 1
if findL == -1:
	print(n)
else:
	print(findL + n - 1 - findR)


def solve(n, m, t):
	count = 0
	while True:
		if len(t) == 0:
			return count
		elif t[0] <= m:
			count += 1
			t.pop(0)
		elif t[-1] <= m:
			count += 1
			t.pop()
		else:
			return count
(n, m) = map(int, input().split())
t = list(map(int, input().split()))
print(solve(n, m, t))


(n, k) = map(int, input().split())
a = []
cnt = 0
a = list(map(int, input().split()))
if len(a) == n:
	for i in range(n):
		if a[0] <= k:
			a.pop(0)
			cnt = cnt + 1
		elif a[len(a) - 1] <= k:
			a.pop(len(a) - 1)
			cnt = cnt + 1
		else:
			break
print(cnt)


(n, k) = input().split()
(n, k) = [int(n), int(k)]
prob = input().split()
for i in range(len(prob)):
	prob[i] = int(prob[i])
count = 0
left = 0
right = n - 1
mark = True
while mark and right >= 0 and (left <= n - 1):
	if prob[left] > k and prob[right] > k:
		mark = False
	elif prob[left] <= k:
		mark = True
		count = count + 1
		left = left + 1
	elif prob[right] <= k:
		mark = True
		count = count + 1
		right = right - 1
print(count)


a = input()
a = a.split(' ')
k = int(a[1])
a = input()
a = a.split(' ')
y = len(a)
t = 0
while int(a[0]) <= k:
	del a[0]
	if len(a) == 0:
		break
a.reverse()
if len(a) > 0:
	while int(a[0]) <= k:
		del a[0]
		if len(a) == 0:
			break
print(y - len(a))


(n, k) = list(map(int, input().split()))
pb = list(map(int, input().split()))
(front, back) = (pb[0], pb[-1])
count = 0
status = True
while status and bool(len(pb)):
	count += 1
	if k >= front:
		pb.pop(0)
		if len(pb) != 0:
			front = pb[0]
	elif k >= back:
		pb.pop(-1)
		if len(pb) != 0:
			back = pb[-1]
	else:
		status = False
		count -= 1
print(count)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
(mn, mx) = (n, -1)
for i in range(n):
	if a[i] > k:
		mn = min(mn, i)
		mx = max(mx, i)
if mn > mx:
	print(n)
else:
	print(n - (mx - mn + 1))


(n, k) = input().split()
n = int(n)
k = int(k)
list1 = [int(x) for x in input().split()]
counter = 0
while len(list1) > 0:
	if list1[0] <= k or list1[-1] <= k:
		if list1[0] <= k:
			list1.remove(list1[0])
		elif list1[-1] <= k:
			list1.pop()
		counter += 1
	else:
		break
print(counter)


List = []
flag = 0
(n, k) = [int(x) for x in input().split()]
List = [int(x) for x in input().split()]
right = 0
while flag < 2:
	flag = 0
	if len(List) > 0:
		if List[right] <= k:
			List.pop(right)
		else:
			flag = flag + 1
	if len(List) > 0:
		left = len(List) - 1
		if List[left] <= k:
			List.pop(left)
		else:
			flag = flag + 1
	else:
		flag = 2
print(n - len(List))


inp = list(map(int, input().split()))
n = inp[0]
k = inp[1]
inp = list(map(int, input().split()))
count = 0
for item in inp:
	if item > k:
		count += 1
if count == 0:
	print(len(inp))
else:
	a = inp
	count = 0
	for i in range(len(a)):
		if a[i] <= k:
			count += 1
		else:
			break
	a.reverse()
	for i in range(len(a)):
		if a[i] <= k:
			count += 1
		else:
			break
	print(count)


def contest(arr, k):
	ans = 0
	while True:
		try:
			if arr.pop(0) <= k:
				ans += 1
			else:
				break
		except IndexError:
			break
	while True:
		try:
			if arr.pop() <= k:
				ans += 1
			else:
				break
		except IndexError:
			break
	return ans
(n, k) = list(map(int, input().rstrip().split()))
arr = list(map(int, input().rstrip().split()))
print(contest(arr, k))


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
r = a[::-1]
count = 0
for i in range(len(a)):
	if a[0] <= k:
		count = count + 1
		a.pop(0)
	else:
		for j in range(len(a)):
			if r[0] <= k:
				count = count + 1
				r.pop(0)
print(count)


(n, k) = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
s = [i for (i, v) in enumerate(x) if v > k]
if len(s) == 0:
	print(len(x))
else:
	print(len(x) - (s[-1] - s[0] + 1))


o = input().rstrip().split(' ')
p = input().rstrip().split(' ')
s = 0
G = -789
for i in range(0, len(p)):
	if int(p[i]) <= int(o[1]):
		s = s + 1
	else:
		G = i
		break
if G != -789:
	for i in range(len(p) - 1, G, -1):
		if int(p[i]) <= int(o[1]):
			s = s + 1
		else:
			break
print(s)


def main():
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	for (i, a) in enumerate(l):
		if k < a:
			r = i
			break
	for (i, a) in enumerate(reversed(l)):
		if k < a:
			r += i
			break
	else:
		r = n
	print(r)
main()


n = input()
n = n.split()
k = int(n[1])
n1 = int(n[0])
d = 0
e = 0
a = input()
a = a.split()
for i in range(n1):
	if int(a[i]) <= k:
		d += 1
	else:
		e = 1
		break
if e == 1:
	for i in range(n1 - 1, -1, -1):
		if int(a[i]) <= k:
			d += 1
		else:
			break
print(d)


(n, k) = [int(i) for i in input().split()]
res = 0
mas = [int(i) for i in input().split()]
lmas = len(mas)
while lmas > 0 and (mas[-1] <= k or mas[0] <= k):
	if mas[0] <= k:
		lmas -= 1
		res += 1
		mas = mas[1:]
	if lmas > 0 and mas[-1] <= k:
		lmas -= 1
		res += 1
		mas = mas[:-1]
print(res)


(a, y) = [int(i) for i in input().split()]
z = [int(i) for i in input().split()]
x = 0
p = 0
for i in range(a):
	if z[i] <= y:
		x = x + 1
	else:
		break
for j in range(a):
	if z[a - p - 1] <= y:
		x = x + 1
		p = p + 1
	else:
		break
s = x
if s > a:
	print(s // 2)
else:
	print(s)


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
t = []
p = 0
l = 0
n = 0
for i in range(len(c)):
	t.append(c[p])
	p = p + 1
z = len(t)
if not len(t) == 0:
	while t[0] <= b:
		t.remove(t[0])
		if len(t) == 0:
			break
if not len(t) == 0:
	t.reverse()
	while t[0] <= b:
		t.remove(t[0])
		if len(t) == 0:
			break
print(a - len(t))


R = lambda : map(int, input().split())
(n, k) = R()
a = list(R())
D = lambda l: next((i for (i, x) in enumerate(l) if x > k), len(a))
r = D(a)
print((r, r + D(a[::-1]))[r < len(a)])


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
count = 0
l = 0
r = 0
while len(arr):
	z = arr.pop()
	if z <= k:
		count += 1
	else:
		break
arr.reverse()
while len(arr):
	z = arr.pop()
	if z <= k:
		count += 1
	else:
		break
print(count)


(n, k) = input().split()
(n, k) = (int(k), int(k))
arr = list(map(int, input().split()))
l = 0
n = len(arr)
r = n - 1
count = 0
for i in range(n):
	if r < l:
		break
	if arr[l] <= k:
		count += 1
		l += 1
	elif arr[r] <= k:
		count += 1
		r -= 1
	else:
		break
print(count)


(n, k) = map(int, input().split(' '))
s = list(map(int, input().split(' ')))
l = -1
for i in range(n):
	if s[i] > k:
		l = i
		break
r = -1
for i in reversed(range(n)):
	if s[i] > k:
		r = i
		break
if l == -1:
	print(n)
else:
	print(n - (r - l + 1))


(n, k) = (int(v) for v in input().split())
list1 = [int(u) for u in input().split()]
ans = 0
for i in range(n):
	if list1[i] <= k:
		ans += 1
	else:
		break
for j in range(n):
	if list1[n - 1 - j] <= k:
		ans += 1
	else:
		break
print(min(ans, n))


(a, b) = map(int, input().split())
s = [int(x) for x in input().split()]
ans = 0
key = False
for (i, x) in enumerate(s):
	if x > b:
		ans = i
		key = True
		break
if key:
	for (i, x) in enumerate(s[::-1]):
		if x > b:
			ans += i
			break
	print(ans)
else:
	print(a)


(n, k) = map(int, input().split())
t = list(map(int, input().split()))
s = 0
while s < n and t[s] <= k:
	s += 1
while n > 0 and t[n - 1] <= k:
	n -= 1
if s > n:
	print(len(t))
else:
	print(len(t) - n + s)


(useless, k) = map(int, input().split())
lis = input().split(' ')
n = len(lis)
count = 0
for i in range(n):
	if int(lis[0]) <= k:
		del lis[0]
		count += 1
	elif int(lis[-1]) <= k:
		del lis[-1]
		count += 1
	else:
		break
print(count)


(n, k) = [int(x) for x in input().split()]
p = list(map(int, input().split()))

def find_hard(l):
	hard = [i for (i, v) in enumerate(l) if v > k]
	if hard:
		return (hard[0], hard[-1])
	else:
		return (0, -1)
(a, b) = find_hard(p)
print(len(p) - (b - a + 1))


l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
n = max(l2)
if n <= l1[1]:
	print(l1[0])
	exit()
else:
	np = 0
	for i in l2:
		if i <= l1[1]:
			np += 1
		else:
			break
	l2.reverse()
	for i in l2:
		if i <= l1[1]:
			np += 1
		else:
			break
	print(np)


(n, k) = map(int, input().split(' '))
ll = list(map(int, input().split(' ')))
probs = 0
while len(ll) > 0:
	if ll[0] > k and ll[-1] > k:
		break
	elif ll[0] > k:
		probs += 1
		ll.pop(-1)
	elif ll[-1] > k:
		probs += 1
		ll.pop(0)
	else:
		probs += 1
		ll.pop(0)
print(probs)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
start = 0
end = n - 1
ans = 0
while start <= end:
	if a[start] <= k:
		start += 1
		ans += 1
	elif a[end] <= k:
		end -= 1
		ans += 1
	else:
		break
print(ans)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
coun = 0
ans = 0
for i in range(len(a)):
	if a[i] <= k:
		coun = coun + 1
	else:
		break
if coun != n:
	for i in reversed(a):
		if i <= k:
			ans = ans + 1
		else:
			break
print(ans + coun)


(n, k) = input().split()
n = int(n)
k = int(k)
l = [int(i) for i in input().split()]
i = 0
mid = 0
while len(l) > 0:
	if l[i] <= k:
		l.pop(i)
		if mid == 1:
			i = len(l) - 1
	elif l[i] > k and mid == 1:
		break
	else:
		mid = 1
		i = len(l) - 1
print(n - len(l))


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
cnt = 0
for i in range(n):
	if a[i] <= k:
		cnt += 1
		a[i] = 0
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k and a[i] != 0:
		cnt += 1
		a[i] = 0
	else:
		break
print(cnt)


list0 = [int(a) for a in input('').split()]
n = list0[0]
k = list0[1]
difficulty = [int(b) for b in input('').split()]
num = 0
a = 0
for i in range(0, n):
	if k >= difficulty[i]:
		num += 1
	else:
		a = 1
		break
if a == 1:
	for j in reversed(difficulty):
		if k >= j:
			num += 1
		else:
			break
print(num)


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
(lo, hi) = (0, n - 1)
while lo <= hi and k >= arr[lo]:
	lo += 1
while lo <= hi and k >= arr[hi]:
	hi -= 1
print(n - (hi - lo) - 1)


(n, k) = input().split()
n = int(n)
k = int(k)
i = 0
arr = []
total = False
arr = list(map(int, input().split()))
count = 0
arrcount = 0
for i in arr:
	if arrcount == len(arr) - 1:
		total = True
	if i > k:
		break
	count += 1
	arrcount += 1
for i in reversed(arr):
	if total:
		break
	if i > k:
		break
	count += 1
print(count)


a = input()
(n, k) = a.split()
n = int(n)
k = int(k)
a = input().split()
i = 0
p12345 = True
while p12345:
	if int(a[0]) <= k:
		i += 1
		del a[0]
		if len(a) == 0:
			break
	elif int(a[-1]) <= k:
		i += 1
		del a[-1]
		if len(a) == 0:
			break
	else:
		p12345 = False
print(i)


(n, k) = map(int, input().split())
a = [int(i) for i in input().split()]
j = 0
while len(a) > 0:
	if a[0] <= k:
		j += 1
		del a[0]
	elif a[len(a) - 1] <= k:
		j += 1
		del a[len(a) - 1]
	else:
		break
print(j)


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
ans = 0
l = 0
r = len(a) - 1
for i in range(l, r + 1):
	if a[i] <= k:
		ans += 1
	else:
		break
if ans == n:
	print(ans)
	exit()
else:
	j = r
	while j > l:
		if a[j] <= k:
			ans += 1
		else:
			break
		j -= 1
print(ans)


a = input()
a = a.split()
probs = int(a[0])
skill = int(a[1])
lst = input()
lst = lst.split()
lst = list(map(int, lst))
while len(lst) > 0:
	if lst[0] > skill and lst[-1] > skill:
		break
	if lst[0] <= skill:
		lst.pop(0)
	if len(lst) > 0:
		if lst[-1] <= skill:
			lst.pop(-1)
print(probs - len(lst))


s = 0
(x, y) = map(int, input().split())
a = list(map(int, input().split()))
if max(a) <= y:
	print(x)
else:
	for i in range(x):
		if y >= a[i]:
			s += 1
		else:
			break
	for i in range(-1, -x - 1, -1):
		if y >= a[i]:
			s += 1
		else:
			break
	print(s)


(n, k) = map(int, input().split())
a = [i for i in map(int, input().split())]
same = [i for i in a]
for i in a:
	if same[0] <= k:
		del same[0]
	elif same[-1] <= k:
		del same[-1]
print(len(a) - len(same))


(count, m_power) = map(int, input().split())
tasks_power = [int(a) for a in list(input().split())]
length = len(tasks_power)
if tasks_power[0] > m_power and tasks_power[length - 1] > m_power:
	print(0)
else:
	count = 0
	try:
		while tasks_power[0] <= m_power:
			tasks_power.pop(0)
			length -= 1
			count += 1
		while tasks_power[length - 1] <= m_power:
			tasks_power.pop(length - 1)
			length -= 1
			count += 1
	except:
		pass
	finally:
		print(count)


(n, k) = input().split()
n = int(n)
k = int(k)
l = list(map(int, input().split()))
i = 0
j = n - 1
ans = 0
while i < n and l[i] <= k:
	i += 1
	ans += 1
while j > i and l[j] <= k:
	j -= 1
	ans += 1
print(ans)


inp = input().split()
n = int(inp[0])
k = int(inp[1])
arr = list(map(int, input().split()))
if k >= max(arr):
	print(len(arr))
else:
	i = 0
	j = len(arr) - 1
	count = 0
	for i in range(len(arr)):
		if arr[i] > k:
			break
		else:
			count += 1
	for i in range(len(arr) - 1, -1, -1):
		if arr[i] > k:
			break
		else:
			count += 1
	print(count)


(n, k) = map(int, input().split())
a = [*map(int, input().split())]
res = 0
for _ in range(2):
	while a and a[-1] <= k:
		a.pop()
		res += 1
	a = a[::-1]
print(res)


(a, b) = map(int, input().split())
x = [int(q) for q in input().split()]
i = 0
j = len(x) - 1
s = 0
while i < len(x):
	if x[i] <= b:
		s += 1
		i += 1
	elif x[j] <= b:
		s += 1
		j -= 1
	else:
		break
print(s)


(n, k) = map(int, input().split())
l = ['1' if int(x) <= k else '0' for x in input().split()]
l = ''.join(l)
l = l.strip('1')
print(n - len(l))


from sys import stdin, stdout
from collections import Counter
(a, b) = map(int, stdin.readline().split())
l = list(map(int, stdin.readline().split()))
count = 0
for k in range(len(l)):
	if l[k] <= b:
		count += 1
	else:
		break
l = l[::-1]
for j in range(len(l)):
	if l[j] <= b:
		count += 1
	else:
		break
stdout.write(str(min(a, count)))


[n, k] = list(map(int, input().split(' ')))
data = list(map(int, input().split(' ')))
tmp = len(data)
count = 0
while tmp > 0:
	if data[0] <= k:
		count += 1
		del data[0]
	elif data[-1] <= k:
		count += 1
		del data[-1]
	else:
		break
	tmp = len(data)
print(count)


(N, K) = map(int, input().strip().split())
A = list(map(int, input().strip().split()))
ans = 0
for i in range(N):
	if A[i] <= K:
		ans += 1
	else:
		break
stop = ans - 1
for i in range(N):
	if N - 1 - i == stop:
		break
	if A[N - 1 - i] <= K:
		ans += 1
	else:
		break
print(ans)


inp_n_k = input()
count = 0
n = int(inp_n_k[:inp_n_k.find(' ')])
k = int(inp_n_k[inp_n_k.find(' ') + 1:])
problems_str = input().split(' ')
for i in range(n):
	if k >= int(problems_str[0]):
		count += 1
		problems_str.pop(0)
	elif k >= int(problems_str[-1]):
		count += 1
		problems_str.pop(-1)
	else:
		break
print(count)


def read():
	return int(input())
(n, k) = input().split()
n = int(n)
k = int(k)
a = [int(i) for i in input().split()]
left = right = 0
for i in range(0, n):
	if a[i] <= k:
		left += 1
	else:
		break
for i in range(n - 1, -1, -1):
	if a[i] <= k:
		right += 1
	else:
		break
if left == right == n:
	print(n)
else:
	print(left + right)


(n, k) = input().split()
array = []
aux = 0
array = list(map(int, input().split()))
for i in range(int(n)):
	if int(k) >= array[i]:
		aux = aux + 1
	else:
		for j in range(int(n) - i):
			if int(k) >= array[int(n) - j - 1]:
				aux = aux + 1
			else:
				break
		break
print(aux)


import math
import random
import time
import heapq

def getIntList():
	return list(map(int, input().split()))

def getTransIntList(n):
	first = getIntList()
	m = len(first)
	result = [[0] * n for _ in range(m)]
	for i in range(m):
		result[i][0] = first[i]
	for j in range(1, n):
		curr = getIntList()
		for i in range(m):
			result[i][j] = curr[i]
	return result
(n, k) = getIntList()
a = getIntList()
result = 0
for x in a:
	if x > k:
		break
	result += 1
if result < n:
	for x in a[::-1]:
		if x > k:
			break
		result += 1
print(result)


(n, k) = map(int, input().split())
qw = [int(i) for i in input().split()]
c = 0
for i in range(n):
	if qw[i] > k:
		break
	c += 1
for i in range(n - 1, -1, -1):
	if qw[i] > k:
		break
	c += 1
print(min(n, c))


(n, k) = map(int, input().split())
list1 = list(map(int, input().split()))
l3 = []
s = 0
for gh in range(0, len(list1)):
	if list1[gh] <= k:
		s += 1
		l3.append(gh)
	else:
		break
l2 = []
p = 0
for gh in range(len(list1) - 1, -1, -1):
	if list1[gh] <= k:
		p += 1
		l2.append(gh)
	else:
		break
m = 0
for t in range(0, len(l2)):
	if l2[t] in l3:
		m += 1
print(s + p - m)


(n, k) = map(int, input().split(' '))
arr = [int(x) for x in input().split(' ')]
i = 0
j = n - 1
cnt = 0
while i < n and arr[i] <= k:
	cnt += 1
	i += 1
while j >= i and arr[j] <= k:
	cnt += 1
	j -= 1
print(cnt)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
c = 1
counter = 0
while len(l) > 0 and c != 0:
	if l[0] <= k:
		counter += 1
		del l[0]
	elif l[-1] <= k:
		counter += 1
		del l[-1]
	else:
		c = 0
print(counter)


ch = input()
n = int(ch[:ch.index(' ')])
k = int(ch[ch.index(' ') + 1:])
ch = input()
ch = ch + ' '
l = list()
a = ''
for i in range(len(ch)):
	if ch[i] != ' ':
		a = a + ch[i]
	else:
		l.append(int(a))
		a = ''
s = 0
while n > 0 and (l[0] <= k or l[n - 1] <= k):
	if l[0] <= k:
		l.pop(0)
		n = n - 1
		s += 1
	elif l[n - 1] <= k:
		l.pop()
		n = n - 1
		s += 1
print(s)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
v = 0
x = 0
for i in range(n):
	if a[i] > k:
		c = i
		x = 1
		break
for i in range(n - 1, -1, -1):
	if a[i] > k:
		v = i
		x = 1
		break
print(n - (v - c) - x)


def fun(arr, n, k):
	i = 0
	j = n - 1
	while i < n:
		if arr[i] > k:
			break
		i += 1
	ans = i
	while j > i:
		if arr[j] > k:
			break
		j -= 1
		ans += 1
	return ans
(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
print(fun(arr, n, k))


from __future__ import print_function
from queue import Queue
import sys
import math
import os.path

def log(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

def ni():
	return map(int, input().split())

def nio(offset):
	return map(lambda x: int(x) + offset, input().split())

def nia():
	return list(map(int, input().split()))

def toString(aList, sep=' '):
	return sep.join((str(x) for x in aList))

def toMapInvertIndex(aList):
	return {k: v for (v, k) in enumerate(aList)}
(n, k) = ni()
a = nia()
count = 0
while len(a) > 0 and a[0] <= k:
	a.pop(0)
	count += 1
while len(a) > 0 and a[-1] <= k:
	a.pop()
	count += 1
print(count)


(n, k) = list(map(int, input().split()))
i = 0
arr = list(map(int, input().split()))
while arr != []:
	if arr[0] > k:
		break
	arr.pop(0)
	i += 1
while arr != []:
	if arr[-1] > k:
		break
	arr.pop()
	i += 1
print(i)


(n, m) = map(int, input().split())
a = [int(x) for x in input().split()]
k = 0
l = 0
count = 0
z = set()
r = -1
while k != 2:
	if a[l] > m:
		k += 1
	if a[r] > m:
		k += 1
	if a[l] <= m or a[r] <= m:
		k = 0
	if a[l] <= m:
		l += 1
		count += 1
	elif a[r] <= m:
		r -= 1
		count += 1
	if l == n or -r == n:
		break
print(count)