Maxim wants to buy some games at the local game shop. There are $n$ games in the shop, the $i$-th game costs $c_i$.

Maxim has a wallet which can be represented as an array of integers. His wallet contains $m$ bills, the $j$-th bill has value $a_j$.

Games in the shop are ordered from left to right, Maxim tries to buy every game in that order.

When Maxim stands at the position $i$ in the shop, he takes the first bill from his wallet (if his wallet is empty then he proceeds to the next position immediately) and tries to buy the $i$-th game using this bill. After Maxim tried to buy the $n$-th game, he leaves the shop.

Maxim buys the $i$-th game if and only if the value of the first bill (which he takes) from his wallet is greater or equal to the cost of the $i$-th game. If he successfully buys the $i$-th game, the first bill from his wallet disappears and the next bill becomes first. Otherwise Maxim leaves the first bill in his wallet (this bill still remains the first one) and proceeds to the next game.

For example, for array $c = [2, 4, 5, 2, 4]$ and array $a = [5, 3, 4, 6]$ the following process takes place: Maxim buys the first game using the first bill (its value is $5$), the bill disappears, after that the second bill (with value $3$) becomes the first one in Maxim's wallet, then Maxim doesn't buy the second game because $c_2 > a_2$, the same with the third game, then he buys the fourth game using the bill of value $a_2$ (the third bill becomes the first one in Maxim's wallet) and buys the fifth game using the bill of value $a_3$.

Your task is to get the number of games Maxim will buy.


-----Input-----

The first line of the input contains two integers $n$ and $m$ ($1 \le n, m \le 1000$) — the number of games and the number of bills in Maxim's wallet.

The second line of the input contains $n$ integers $c_1, c_2, \dots, c_n$ ($1 \le c_i \le 1000$), where $c_i$ is the cost of the $i$-th game.

The third line of the input contains $m$ integers $a_1, a_2, \dots, a_m$ ($1 \le a_j \le 1000$), where $a_j$ is the value of the $j$-th bill from the Maxim's wallet.


-----Output-----

Print a single integer — the number of games Maxim will buy.


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

Output
3

Input
5 2
20 40 50 20 40
19 20

Output
0

Input
6 4
4 8 15 16 23 42
1000 1000 1000 1000

Output
4



-----Note-----

The first example is described in the problem statement.

In the second example Maxim cannot buy any game because the value of the first bill in his wallet is smaller than the cost of any game in the shop.

In the third example the values of the bills in Maxim's wallet are large enough to buy any game he encounter until he runs out of bills in his wallet.

Difficulty: interview

Starter code:

Solutions:
n, m = [int(x) for x in input().strip().split()]
c = [int(x) for x in input().strip().split()]
a = [int(x) for x in input().strip().split()]

ans = 0
ai = 0
for ci in c:
    if ai < len(a) and a[ai] >= ci:
        ai += 1
        ans += 1
print(ans)


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


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

n1,n2 = mi()
c = list(mi())
a = list(mi())

i = 0
j = 0
cnt = 0
while i<n1 and j<n2:
	cur = c[i]
	if cur<= a[j]:
		j+=1
		cnt+=1
	i+=1
print (cnt)

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

ans = 0
for k in c:
    if not a:
        break
    if a[0] >= k:
        ans += 1
        a.pop(0)
print(ans)



n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
t=0
while(len(a) > 0 and len(b)>0):
    if(a[0] <= b[0]):
        a.pop(0)
        b.pop(0)
        t+=1
    else:
        a.pop(0)
print(t)


n,m = map(int, input().split())
c = list(map(int, input().split()))
d = list(map(int, input().split()))

ci = 0
di=0
ans = 0
for i in range(n):
    if di == m:
        break
    if d[di] >= c[i]:
        di +=1
        ans+=1
print(ans)

input()
c = [int(a) for a in input().split()]
a = [int(a) for a in input().split()]
count = 0
for i in c:
    if len(a) > 0 and i <= a[0]:
        count += 1
        a.pop(0)

print(count)


n, m = [int(v) for v in input().split()]
c = [int(v) for v in input().split()]
a = [int(v) for v in input().split()]

ans = 0

apos = 0
for ci in c:
    if ci <= a[apos]:
        ans += 1
        apos += 1
    if apos >= len(a):
        break

print(ans)


from math import ceil

t = 1
for test in range(t):
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    ans = 0
    index = 0
    for i in a:
        if index>=m:
            break
        if b[index]>=i:
            ans+=1
            index+=1
    print(ans)

def main():
    n, m = map(int, input().split())
    c = list(map(int, input().split()))
    a = list(map(int, input().split()))
    ind = 0
    g = 0
    ret = 0
    while ind < m and g < n:
        if c[g] <= a[ind]:
            ret += 1
            ind += 1
        g += 1
    print(ret)
    return 0
main()

n,m = list(map(int,input().split()))

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

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

answer = 0

game_ind = 0
money_ind = 0


while game_ind < n and money_ind < m:

    if moneys[money_ind] >= games[game_ind]:
        answer+=1
        game_ind+=1
        money_ind+=1
    else:
        game_ind+=1

print(answer)


#JMD
#Nagendra Jha-4096
 
#a=list(map(int,sys.stdin.readline().split(' ')))
#n,k,s= map(int, sys.stdin.readline().split(' '))
 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
#a=list(map(int,sys.stdin.readline().split(' ')))
n,m= map(int, sys.stdin.readline().split(' '))
c=list(map(int,sys.stdin.readline().split(' ')))
a=list(map(int,sys.stdin.readline().split(' ')))
ans=0

for i in range(n):
    if(len(a) and c[i]<=a[0]):
        del(a[0])
        ans+=1
print(ans)
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

n, m = map(int, input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
b.append(-1)

f = 0
ans = 0

for i in a:
    if b[f] >= i:
        f += 1
        ans += 1

print(ans)

n, m = list(map(int, input().split(' ')))
prices = list(map(int, input().split(' ')))
money = list(map(int, input().split(' ')))

res = 0
cur = 0
for price in prices:
	if money[cur] >= price:
		res += 1
		cur += 1
	if cur >= len(money):
		break
print(res)


def main():
    n,m = [int(x) for x in input().split()]
    g = [int(x) for x in input().split()]
    a = [int(x) for x in input().split()]
    count = 0
    for i in g:
        if i<=a[count]:
            count+=1
            if count==len(a):
                break
    print(count)


def __starting_point():
    main()


__starting_point()

def ma():
  return list(map(int, input().split()))
n, m = ma()
i, j = 0, 0
A = list(ma())
B = list(ma())
ans = 0
while i < len(A) and j < len(B):
  if A[i] <= B[j]:
    j += 1
    i += 1
    ans += 1
  else:
    i += 1
print(ans)


n,m = list(map(int,input().split()))
ci = list(map(int,input().split()))
ai = list(map(int,input().split()))
i = 0
j = 0
ans = 0
while i < n and j < m:
    if ci[i] > ai[j]:
        i += 1
    else:
        i += 1
        j += 1
        ans += 1
print(ans)


n,m=list(map(int,input().strip().split()))
ci=list(map(int,input().strip().split()))
ai=list(map(int,input().strip().split()))
i=0
j=0
count=0
while(i<n and j<m):
	if ci[i]<=ai[j]:
		i=i+1
		j=j+1
		count=count+1
	else:
		i=i+1
print (count)



n, m = map(int, input().split())
a = [int(elem) for elem in input().split()]
b = [int(elem) for elem in input().split()]
ans = 0
for i in range(n):
    if len(b) > 0 and a[i] <= b[0]:
        b = b[1:]
        ans = ans + 1
print(ans)

import bisect
n,m=input().strip().split(' ')
n,m=int(n),int(m)
c=list(map(int,input().strip().split(' ')))
a=list(map(int,input().strip().split(' ')))
i=0
j=0
cnt=0
while(i<n and j<m):
    if(a[j]>=c[i]):
        cnt+=1
        i+=1
        j+=1
    else:
        i+=1
print(cnt)


n, m = map(int, input().split())
c = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = 0

a.append(0)

for i in range(n):
    if c[i] <= a[0]:
        ans += 1
        a.pop(0)

print(ans)

n,m =  list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
for i in a:
    if b:
        if b[0] >= i:
            c+=1
            b.remove(b[0])
print(c)




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


N,M=map(int,input().split())
n=list(map(int,input().split()))
m=list(map(int,input().split()))
count=0
for i in n:
    if len(m)==0:
        break
    if m[0]>=i:
        count+=1
        m.pop(0)
print(count)

#!/usr/bin/env python3
from sys import stdin, stdout

def rint():
    return list(map(int, stdin.readline().split()))
#lines = stdin.readlines()


n, m = rint()

c = list(rint())
a = list(rint())

j = 0
cnt = 0
for i in range(n):
    if j >= m:
        break
    if c[i] <= a[j]:
        cnt += 1
        j += 1

print(cnt)