from bisect import bisect
from collections import defaultdict
# l = list(map(int,input().split()))
# map(int,input().split()))
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)

n, k = map(int, input().split())
s = list(map(int, input().split()))
sch = 0
l = 0
for i, el in enumerate(s):
    if el <= k:
        l = i
        sch += 1
    else:
        break

if sch != len(s):
    for i, el in enumerate(s[::-1]):
        if el <= k and len(s) - i > l:
            sch += 1
        else:
            break
print(sch)

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

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)

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)

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)

n,k=map(int,raw_input().split(" "))

l=map(int,raw_input().split(" "))
if max(l)<=k:
    print n
else:
    c=0
    i=0
    while l[i]<=k:
        c+=1
        i+=1
        if i>=n:
            break
    i=-1
    while l[i]<=k:
        c+=1
        i-=1
        if i<-n:
            break

    print c

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
        continue
    if(a[i]>k and a[j]>k):
        break
print(ans)

from collections import deque
a = map(int,raw_input().split())
k = a[1]
n = a[0]
a = map(int,raw_input().split())
d = deque()
s = 0
for i in a:
    if(i <= k):
        s+=1
    else:
        break

if(s == n):
    print s
else:
    l = a[::-1]
    for i in l:
        if(i <= k):
            s+=1
        else:
            break
    print s

def func():
    n, k = [int(x) for x in list(raw_input().split(' '))]
    a = [int(x) for x in list(raw_input().split(' '))]

    result = 0
    id = 0
    for idx, i in enumerate(a):
        if i <= k:
            result += 1
        else:
            id = idx
            break

    if result == len(a):
        return result

    for idx in range(len(a)-1, id, -1):
        if a[idx] <= k:
            result += 1
        else:
            break

    return result

if __name__ == "__main__":
    print(func())

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)

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')

#Abhigyan Khaund - syl

n,k = map(int, raw_input().split())
a = map(int, raw_input().split())
ans = 0
while (len(a)>0 and (a[0]<=k or a[-1]<=k)):
	ans+=1
	if(a[0]<=k):
		a = a[1:]
	else:
		a = a[:len(a)-1]
print ans

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)

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)

import sys,math,collections
from collections import defaultdict

#from itertools import permutations,combinations

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) :

    # Base cases
    if (x == 0 or x == 1) :
        return x

    # Do Binary Search for floor(sqrt(x))
    start = 1
    end = x
    while (start <= end) :
        mid = (start + end) // 2

        # If x is a perfect square
        if (mid*mid == x) :
            return mid

        # Since we need floor, we update
        # answer when mid*mid is smaller
        # than x, and move closer to sqrt(x)
        if (mid * mid < x) :
            start = mid + 1
            ans = mid

        else :

            # If mid*mid is greater than x
            end = mid-1

    return ans
#file()
def main():
	#for tt in range(int(input())):
	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()
	#print(l)
	for i in range(n):
		if(l[i]=='h'):
			break
		elif(l[i]<=m):
			c+=1
		else:
			break
	print(c)

if __name__ == '__main__':
    main()

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))

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(a)
print(s)

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))

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,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,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)

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

n, k = map(int, raw_input().split())
a = map(int, raw_input().split())
out = 0
for e in a :
    if e > k :
        a = a[::-1]
        for x in a :
            if x > k :
                break
            out += 1
        break
    out += 1
print out

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))

# -*- coding: utf-8 -*-

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()]
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 = map(int, input().split())
l = list(map(int, input().split()))

for i in range(n):
    if l[0] <= k:
        l.pop(0)
    elif l[-1] <= k:
        l.pop(-1)
    else:
        break

print(n - len(l))

a,b = map(int, input().split())
c = list(map(int, input().split()))
count = 0
for i in range(a):
    if c[i] <= b:
        count += 1
    else:
        break
for j in range(a-1,0,-1):
    if c[j] <= b:
        count += 1
    else:
        break
print(a if count > a else 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)

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())
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)

from collections import deque
n, k = map(int, raw_input().split())
l = map(int, raw_input().split())
l = deque(l)
cont = 0
continuarI = True
continuarF = True
reverter = False
while((continuarI or continuarF) and cont < n):
  if(reverter):
    if(l[n-(cont+1)] <= k):
      cont += 1
      l.pop()
    else:
      continuarF = False
    reverter = False
  else:
    if(l[0] <= k):
      cont += 1
      l.popleft()
    else:
      continuarI = False
    reverter = True

print(cont)

import sys
from collections import deque

n,k = list(map(int,sys.stdin.readline().strip().split(' ')))
l = list(map(int,sys.stdin.readline().strip().split(' ')))

l = deque(l)
ans = 0

while l:
	if l[0] <= k:
		l.popleft()
		ans += 1
	elif l[-1] <= k:
		l.pop()
		ans += 1
	else:
		break
print(ans)

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)

# cook your code here
n,k=map(int,raw_input().split(' '))
a=map(int,raw_input().split(' '))

left=0
right=n-1
check=True
while(check==True and left<n):
    if(a[left]>k):
        check=False
    else:
        left=left+1

check=True
while(check==True and right>=0):
    if(a[right]>k):
        check=False
    else:
        right=right-1

right=n-1-right

if(left+right>n):
    print(n)
else:
    print(left+right)

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())
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)

n, k = map(int, raw_input().split())
arr = map(int, raw_input().split())
count = 0
i, j = 0, n-1
while i<= j:
	first = arr[i]
	last = arr[j]
	if 0<first<=k:
		count += 1
		arr[i] = -1
		i += 1

	elif 0<last and last<=k:
		count += 1
		arr[j] = -1
		j -= 1
	else:
		break
print count

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)

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**.5)+1
        for i in range(2,p):
            if x%i==0:
                return 0
        return 1

################################################################################

"""
l=sorted(list(map(int,z().split())))[::-1]

a,b=map(int,z().split())

l=set(map(int,z().split()))

led=(6,2,5,5,4,5,6,3,7,6)

vowel={'a':0,'e':0,'i':0,'o':0,'u':0}

color4=["G", "GB", "YGB", "YGBI", "OYGBI" ,"OYGBIV",'ROYGBIV' ]

"""

###########################---START-CODING---###############################################

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))

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)

# Problem A

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))

# Problem B
# from string import ascii_lowercase

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

# delete_count = 0
# for i in ascii_lowercase:
#     if delete_count == k:
#         break
#     while(True):
#         count = s.count(i)
#         if count > 0 and delete_count <= k:
#             index = s.find(i)
#             # print('here:', index)
#             s = s[:index] + s[index+1:]
#             # print('->', s)
#             delete_count += 1
#         if count == 0 or delete_count == k:
#             break

# print(s)

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)

problemas, nivel = map(int, raw_input().split())

i = 0
j = problemas - 1

impi = False
impj = False
cont = 0

if problemas > 0:

	entrada = map(int, raw_input().split())

	while True:

		if i != j:

			if entrada[i] <= nivel:

				cont += 1
				i += 1

			else:

				impi = True

			if entrada[j] <= nivel:

				cont += 1
				j -= 1

			else:

				impj = True

			if i > j:

				break

		else:

			if entrada[i] <= nivel:

				cont += 1
				break

			else:

				break

		if impj and impi:

			break

print cont

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)

class MishkaAndContest:
    def solve(self,numprobs,mishkaskill,probdiff):
        solvablecnt = 0
        solvedprobs=[]
        for problem in range(0,len(probdiff)):
            if probdiff[problem]<=mishkaskill:
                solvablecnt+=1
            else:
                solvedprobs=probdiff[problem:]
                break
        if len(solvedprobs)==0: return solvablecnt
        solvedprobs=solvedprobs[::-1]
        for rev in solvedprobs:
            if rev<=mishkaskill:
                solvablecnt+=1
            else:
                break
        return solvablecnt
if __name__ == "__main__":
    numprobs,mishkaskill = map(int,raw_input().split(" "))
    probdiff = map(int,raw_input().split(" "))
    mac = MishkaAndContest()
    print mac.solve(numprobs,mishkaskill,probdiff)

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())
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()))

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=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(z)
print(count+counti)

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

if __name__ == "__main__":

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

    problemList = list(map(int,input().split()))
    #print(problemList)

    result = FindMax(0, n-1)
    print(result)
    #print(problemList)

a=[]
for x in raw_input().split():
    a.append(int(x))
n=a[0]
k=a[1]
count=0
p = []
#print(n)
#print(k)
#print(count)
for x in raw_input().split():
    p.append(int(x))
for i in range(n):
        if p[i]<=k:
                count+=1
        else:
                 break
for j in range(n-1,0,-1):
        if(p[j]<=k and j>i):
                count+=1;
        else:
                 break
print(count)

z=input
import math
n,k=map(int,z().split())
c=0
l=list(((map(int,z().split()))))

for i in l:
    if i<=k:
        c+=1
    else:
        break
for i in l[::-1]:
    if i<=k:
        c+=1
    else:
        break
if c>=n:
    c=n
print(c)

###
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()))
#5 100

#n, k = list(map(int, '5 100'.split()))
#seq = list(map(int, '12 34 55 43 21'.split()))

ctr = 0
while seq: #right
    if seq[0] <= k:
        ctr+= 1
        seq.pop(0)
    else:
        break
while seq: #left
    if seq[-1] <= k:
        ctr+= 1
        seq.pop(-1)
    else:
        break
print(ctr)

# -*- coding:utf-8 -*-
#[n, m] = [int(x) for x in raw_input().split()]
def some_func():
    """
    """
    n,k = [int(x) for x in raw_input().split()]
    n_list = [int(x) for x in raw_input().split()]
    cost = 0
    for v in n_list:
        if v<=k:
            cost+=1
        else:
            break
    for v in n_list[::-1]:
        if v<=k:
            cost+=1
        else:
            break

    return min(n, cost)

if __name__ == '__main__':
    print some_func()

n, k = map(int, raw_input().split())
a = map(int, raw_input().split())
count = 0

for i in range(len(a)):
	if not a: break
	if a[0] <= k:
		del a[0]
		count += 1
	if not a: break
	if a[-1] <= k:
		del a[-1]
		count += 1
print count

#!/usr/bin/env python
n, k = [int(x) for x in raw_input().split()]
a = [True if int(x) <= k else False for x in raw_input().split()]
print n if all(a) else a.index(False) + a[::-1].index(False)

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)

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 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 = list(map(int, input().split()))

l = 0
for i in range(n):
    if a[i] <= k:
        l += 1
    else:
        break
r = 0
for i in range(n-1, -1, -1):
    if a[i] <= k:
        r += 1
    else:
        break

print(min(n, l+r))

n,k=raw_input().strip().split(' ')
n,k=[int(n),int(k)]
a=map(int,raw_input().strip().split(' '))
count=0
co=0
for i in range(n):
    if a[i]<=k:
        count+=1
    elif a[i]>k:
        break
for i in range(n-1,-1,-1):
    if a[i]<=k:
        co+=1
    elif a[i]>k:
        break
if count<n or co<n:
    print count+co
else:
    print n

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)

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()))
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)

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)

__author__ = 'Devesh Bajpai'

'''
https://codeforces.com/problemset/problem/999/A

Solution:
'''

def solve(n, k, arr):

    i = 0
    while i < n and arr[i] <= k:
        i += 1

    j = n-1
    while j > i and arr[j] <= k:
        j -= 1

    return i + (n - j) - 1

if __name__ == "__main__":

    n, k = map(int, raw_input().split(" "))
    arr = map(int, raw_input().split(" "))
    print solve(n, k, arr)

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 = map(int, raw_input().split())
arr = map(int, raw_input().split())

ans = 0
while len(arr) > 0 and arr[0] <= k:
    ans += 1
    arr.pop(0)

while len(arr) > 0 and arr[-1] <= k:
    ans += 1
    arr.pop(-1)

print ans

from sys import stdin

lines = stdin.readlines()
n,k = map(int,lines[0].split())
a = map(int,lines[1].split())
summ = 0
flag = True
while flag:
    if a == []:
        print summ
        flag = False
    elif a[0] <= k:
        summ += 1
        del a[0]
    elif a[-1] <= k:
        summ += 1
        del a[-1]
    else:
        print summ
        flag = False

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))

n,k = map(int, raw_input().split())
t = map(int, raw_input().split())
wyn = 0
for x in range(0, len(t), +1):
    if t[x] <= k:
        wyn += 1
        t[x] = 101
    else:
        break
for x in range(len(t)-1,-1, -1):
    if t[x] <= k:
        wyn += 1
        t[x] = 101
    else:
        break
print wyn

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)

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

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())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
    if a[i] <= k:
        ans += 1
        #print(a[i])
    else: break
for i in range(n)[::-1]:
    if a[i] <= k:
        ans += 1
        #print(a[i])
    else: break
if ans > n:
    ans -= n
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())
l=list(map(int,input().split()))
c=0
for i in range(n):
    if(l[i]<=k):
        c+=1
    else:
        break
if(c!=n):

 for i in range(n-1,-1,-1):
    if(l[i]<=k):
        c+=1
    else:
        break

print(c)

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)
            d+=1
        elif(c[len(c)-1]<=b):
            c.pop(len(c)-1)
            d+=1
    print(d)

n , k = map(int, input().split())
c = 0
l = list(map(int, input().split()))
for i in range(n):
    if(l[i] <= k):
        c += 1
    else:
        break
#print('1st loop', c)
if c < len(l):
    l.reverse()
    for i in l:
        if(i <= k):
            c += 1
        else:
            break
    print(c)
else:
    print(c)

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

def solve(i,j):
    if num[i]>k and num[j]>k:
        return 0
    if i>j:
        return 0
    a = 0
    b = 0
    if num[i]<=k:
        a = 1
        i += 1
    if num[j]<=k:
        b = 1
        j -= 1
    #if a==0 and b==0:
     #   return 0
    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=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:
    if l[0]>k:
        print(0)
elif i<j:
    print(count+c2)
elif f==1 and f1==1:
    print(n-1)
else:
    print(n)

n, k = map(int, raw_input().split())
arr = map(int, raw_input().split())
arr2 = []
for i in range(len(arr) - 1, -1, -1):
	arr2.append(arr[i])
count = 0
for i in arr :
	if i <= k:
		count = count + 1

	else :
		break
for i in range(len(arr) - 1, -1 , -1):
	if(arr[i] <= k):
		count = count + 1
	else :
		break

print(count)

l, m = input().split()

string = input()

string = string.split()

temp = list
for index, s in enumerate(string):

    if m < s:
        temp = string[index:]
        break

temp2 = list
for index, s in enumerate(temp):

    if m < s:
        temp2 = temp[index:]
        break

print(int(l)-len(temp2))

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

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<8):
    print(s)
else:
    print(s/2)

var1, var2 = raw_input("Enter two numbers here: ").split()
n=int(var1)
k=int(var2)
count=0
a = []
#print(n)
#print(k)
#print(count)
for x in raw_input().split():
    a.append(int(x))
i=0
while a[i]<=k and i<n:
        count+=1
        i+=1
print(count)
j=n-1
while a[j]<=k and j>i:
        count+=1
        j-=1
print(count)

n,k=map(int,raw_input().split(" "))
A=list(map(int,raw_input().split(" ")))
ct=0
while(A!=[]):
	if(A[0]<=k):
		ct=ct+1
		A.remove(A[0])
	elif(A[-1]<=k):
		ct=ct+1
		A.remove(A[-1])
	else:
		break
print(ct)

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
        else:
            end = i
print(n - (end - begin + 1))

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

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

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
    break
for i in range(len(arr) - 1, -1, -1):
  if arr[i] > k:
    right = i
    break
if left == 0 and right == 0:
  res = len(arr)
else:
  res = len(arr) - (right - left + 1)
print(res)

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

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,0,-1):
    if m>=l[i]:
        x+=1
    else:
        break
if x==z:
    print(z)
else:
    print(x+z)

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())
a=list(map(int,input().split()))
d=0
for i in range(n):
    if min(a[0],a[n-1])<=k:
        a.remove(min(a[0],a[n-1]))
        d+=1
        n-=1
print(d)

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

if res != None:
    for i in range(res+1,-1,-1):
        if ai[i] > k:
            break
        else:
            cnt += 1

print(cnt)

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(len(a)):
		if k == 1 and t == 1:
			break
		if a[i] > y and k == 0:
			z[0]=i
			k = k + 1
		if a[len(a)-i-1] > 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))

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

first_row = input("Enter first row: ").split(' ')
tasks_number = first_row[0]
max_taks_level = first_row[1]
contest_tasks = input("Enter second row: ").split(' ')

number_of_solved_tasks = 0
has_unsolved_task = False
for current_task in contest_tasks:
    if (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 (current_task_reverse <= max_taks_level):
            number_of_solved_tasks += 1
        else:
            break
print(number_of_solved_tasks)

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

n,k=map(int,input().split())
a=list(map(int,input().split()))
i=0
j=n-1
c=0
while i<j:
    if a[i]<=a[j] and a[i]<=k:
        i+=1
        c+=1
    elif a[i]>a[j] and a[i]<=k:
        j-=1
        c+=1
    else:
        break
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(0))

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<8):
    print(int(s))
else:
    print(int(s/2))

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]
		print(a)
	if len(a)>0:
		if a[-1]<=k:
			s+=1
			del a[-1]
			# print(a)
print(s)

from sys import stdin
n,k = map(int,stdin.readline().split())
a = map(int,stdin.readline().split())
ans = 0
for i in xrange(n):
    if a[i] > k:
        break

if i < n-1:
    ans = i
    a.reverse()
    for i in a:
        if i <=k:
            ans+=1
        else:
            break
else:
    ans = n
print ans

n = input().split()
k = int(n[1])
n = int(n[0])
a = [int(i) for i in input().split()]
q = 0

for i in a:
    if k >= i:
        q += 1
        a.pop(0)
    else:
        break

for i in a[::-1]:
    if k >= i:
        q += 1
        a.pop(0)
    else:
        break

print(q)

n,k=list(map(int,input().split()))
problems=list(map(int,input().split()))
c = 0
for i in problems:
    if i <= k:
        c+=1
    else:
        problems.reverse()
        break
for i in problems:
    if i <= k:
        c+=1
    else:
        break

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(begin==n-1 or end==0):
        break

    if(l[begin]<=m):
        count+=1
        begin=begin+1
    elif(l[end]<=m):
        count+=1
        end=end-1
    else:
        break
print(count)

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
print(total)

useless,k=map(int,input().split())
lis = input().split(" ")
n=len(lis)
count=0

for i in range(n):
    if k>=int(lis[0]):
        lis.remove(lis[0])
        count+=1

    elif k>=int(lis[-1]):
        lis.remove(lis[-1])
        count+=1

    else:
        break

print(count)

n, m=map(int, input().split())
count=0
li = list(map(int, input().split()))
for i in range(len(li)):
 if li[i] <= m:
  count = count + 1
 else:
  break
for j in range(len(li)-1, -1,-1):
 if li[j]<=m:
  count =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])
i = 0
j = -1
ci = 0
cj = 0
for i in range(n):
    if d[i] > k:
        break
    ci += 1
for i in range(-1, -n - 1, -1):
    if d[j] > k:
        break
    cj += 1
if ci + cj > n:
    print(n)
else:
    print(ci + cj)

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)

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

n, k = map(int, input().split())
mas = list(map(int, input().split()))
s = 0
for i in mas:
    if i <= k:
        s += 1
print(s)

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

import time

(n, k) = (int(i) for i in input().split())
a   = [int(i) for i in input().split()]

start = time.time()

for i in range(n):
    if a[i] >k:
        break

if i!=n-1:
    for j in range(n-1, i, -1):
        if a[j] > k:
            break
    print(i+n-j-1)
else:
    print(n)

finish = time.time()
#print(finish - start)

useless,k=map(int,input().split())
lis = input().split(" ")
n=len(lis)
count=0

for i in range(n):
    if int(lis[0])<=k:
        lis.remove(lis[0])
        count+=1

    elif int(lis[-1])<=k:
        lis.remove(lis[-1])
        count+=1

    else:
        break

print(count)

###
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[0].split()))

#n, k = list(map(int, '5 2'.split()))
#seq = list(map(int, '3 1 2 1 3'.split()))

ctr = 0
while True: #right
    if seq[0] <= k:
        ctr+= 1
        seq.pop(0)
    else:
        break
while True: #left
    if seq[-1] <= k:
        ctr+= 1
        seq.pop(-1)
    else:
        break
print(ctr)

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

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<8):
    print(s)
else:
    print(s/2)

n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
f=1
c=0
for i in range(len(a)):
 if a[i]<k:
  c+=1

if c!=n:
 i=0
 j=0
 for i in range(len(a)):
  if a[i]>k:
   j=i
   break
 for i in range(len(a)-1,-1,-1):
  if a[i]>k:
   k=i
   break

 print j+n-k-1
else:
 print n

a = input()
tasks = input()
n, k = a.split(" ")
if int(n) < 1:
    print(0)
list_of_tasks = tasks.split(" ")
i = 0
print(len(list_of_tasks))
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)

a,b = raw_input().split()
b=int(b)
lis = raw_input().split()
counter =0
temp = sorted(lis)
if b >= int(temp[-1]):
    counter=int(a)
else:
    for l in lis:
        if b >= int(l):
            counter+=1
        else:
            break
    i=-1
    while True:
        if b >= int(lis[i]):
            counter+=1
            i-=1
        else:
            break
print counter

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 += i
		break

if i == N-1 and N > 1 :
	ans = N
else :
	stop = ans
	for i in range(N):
		if N-1-i == stop :
			ans += i
			break
		if A[N-1-i] > K :
			ans += i
			break

print(ans)

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(min(f1,f2)*2)

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-1):
	if(l<=k):
		c=c+1
		l=a[i+1]
	else:
		m=m+1
		if(r<=k):
			c=c+1
			r=a[-(m+1)]
		else:
			print(c)
			break
else:
	print(n)

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
for e in t:
    if e <= cap:
        count += 1
    else:
        break

t = reversed(t)
for e in t:
    if e <= cap:
        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

while step<len(z) :
    if z[-1]<=n[1] :
        count+=1
        del z[-1]
        step+=1
    else :
        break

##print(z)
print(count)

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,0,-1):
    if m>=l[i]:
        x+=1
    else:
        break
if x==z:
    print(z)
else:
    print(x+z)

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)

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

n,k=map(int,input().split())
a=list(map(int,input().split()))
lc=0
rc=0
i=0
j=len(a)-1
while k>=a[i] and i!=len(a)-1:
    lc+=1
    i+=1
if i==len(a)-1:
    print(lc)
else:
    while k>=a[j] and j!=0:
        rc+=1
        j-=1
    print(rc+lc)

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
if i==n-1:
    print(n)
else:
    j=n-1
    while j>=i:
        if a[j]>m:
            break
        else:
            j=j-1
    print(n-(j-i+1))

l, m = input().split()

string = input()

string = string.split()

temp = list
for index, s in enumerate(string):

    if m < s:
        temp = string[index:]
        break
temp = list(reversed(temp))
temp2 = list
for index, s in enumerate(temp):

    if m < s:
        temp2 = temp[index:]
        break

if temp == temp2:
    print(int(l))
else:
    print(int(l)-len(temp2))

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
        #print(a[i])
    else: break
for i in range(n-1, 0, -1):
    if a[i] <= k:
        ans += 1
        #print(a[i])
    else: break
if ans > n:
    ans -= n
print(ans)

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
print(total)

n, k = map(int, raw_input().split())
a = map(int, raw_input().split())
out = 0
for e in a :
    if e > k :
        break
    out += 1
a = a[::-1]
for e in a :
    if e > k :
        break
    out += 1
print out

(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
        q.remove(q[0])
        flag+=1
    if(len(q)>0 and q[-1]<=k):
        ans+=1
        q.remove(q[-1])
        flag+=1
    if(flag==0):
        break
print(ans)

import math
import os
import random
import re
import sys
import functools
from operator import itemgetter, attrgetter
from collections import Counter

if __name__ == '__main__':
    Y = lambda: list(map(int, input().split()))
    P = lambda: map(int, input().split())
    N = lambda: int(input())

    n, k = P()
    a = Y()
    l, r, c = 0, n - 1, 0

    while l < r and (a[l] <= k or a[r] <= k):
        if a[l] <= k:
            l += 1
        if a[r] <= k:
            r -= 1
    print(n if r - l <= 0 else n - (r - l + 1))

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

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:
    print(a, front);
    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:
        print(a, end);
        if a[end]<=k:
            del a[end];
            completed+=1;
            end = len(a)-1;
        if len(a)<=0:
            break;

print(completed);

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

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

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

#-*-coding:utf8;-*-
#qpy:3
#qpy:console

print("This is console module")

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 - 1 or end == 0):
        break
print(count)

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

n, k = input().split()
problems = input().split()
count = 0
for i in range(int(n)):
    if int(problems[0]) <= int(k):
        count += 1
        problems.remove(problems[0])
    elif int(problems[-1]) <= int(k):
        count += 1
        problems.remove(problems[-1])
print(count)

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 i<j:
    print(count+c2)
elif f==1 and f1==1:
    print(n-1)
else:
    print(n)

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)

# Problem A

def solve(lst, k):
    max = 0
    for i in range(0, len(lst)//2):
        if lst[i] <= k:
            max += 1
        else: break

    i = len(lst) - 1
    while i >= len(lst)//2:
        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))

# Problem B

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 i < n-2:
    for j in range(n-1,0,-1):
        if alist[j] <= k:
            count += 1
        else:
            break

print(count)

useless,k=map(int,input().split())
lis = input().split(" ")
n=len(lis)
count=0

for i in range(n):
    if k>=int(lis[0]):
        lis.remove(lis[0])
        count+=1

    elif k>=int(lis[-1]):
        lis.remove(lis[-1])
        count+=1

    else:
        break

print(count)

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
for e in t:
    if e <= cap:
        count += 1
    else:
        break

print(count)

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
        break

if b == 0:
    if a == b:
        b += 1
    b = a-1

if int(n) == 1:
    if int(problems[0])<=int(k):
        print(1)
    else:
        print(0)
else:
    print(int(n)-(b-a)-1)

n , m = map(int, input().split())
a = input()
a = list(map(lambda x: a, a))
print(a)

def reshenie(lst, k):
    b = list()
    c = list()
    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:
                b.append(lst[i])
            elif lst[len(lst) - i - 1] <= k:
                c.append(lst[len(lst) - i - 1])
        return len(lst) - len(b) - len(c)

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 = list(map(int, input().split()))
c = int(0)
f = int(0)
while f != 1:
    if a[0] <= k:
        c += 1
        a.remove(a[0])
    elif a[len(a) - 1] <= k:
        c += 1
        a.remove(a[len(a) - 1])
    else:
        f = 1
    if c == n:
        break
print(c)

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

x,y=map(int,input().split())
z=list(map(int,input().split()))
c=0
for i in range(x):
    if max(z)<=y:
        c=len(z)
        break
    if i%2==0:
        if z[0]<=y:
            c+=1
            del z[0]
    elif i%2!=0:
        if z[-1]<=y:
            c+=1
            del z[-1]
    if z[0]>y and z[-1]>y:
        break
print(c)

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

n,k=map(int,raw_input().split(" "))

l=map(int,raw_input().split(" "))
if max(l)<k:
    print n
else:
    c=0
    i=0
    while l[i]<=k:
        c+=1
        i+=1
        if i>=n:
            break
    i=-1
    while l[i]<=k:
        c+=1
        i-=1
        if i<-n:
            break
    print c

# -*- coding: utf-8 -*-
"""
Created on Wed Oct  3 21:12:33 2018

@author: chirayu jain
8 4
4 2 3 1 5 1 6 4

5 2
3 1 2 1 3

5 100
12 34 55 43 21
"""

n, k = [int(x) for x in input().split()]
str1 = [int(x) for x in input().split()]
count  = 0
temp = 0
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,pro,-1):
    if str1[i] <=k:
        count = count + 1
    else:
        break
print(count)

first_row = input("Enter first row: ").split(' ')
tasks_number = int(first_row[0])
max_taks_level = int(first_row[1])
contest_tasks = input("Enter second row: ").split(' ')

number_of_solved_tasks = 0
has_unsolved_task = False
for current_task in contest_tasks:
    print(current_task)
    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())
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
while len(arr)!=0:
    m=len(arr)-1
    if arr[m]<=k:
        count+=1
        arr.remove(arr[m])
    else:
        break
print(count)

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

n , m = map(int, input().split())
a = input()
print(a)

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)