*CodeChef recently revamped its [practice page] to make it easier for users to identify the next problems they should solve by introducing some new features:* 
*Recent Contest Problems - contains only problems from the last 2 contests*
*Separate Un-Attempted,  Attempted, and All tabs*
*Problem Difficulty Rating - the Recommended dropdown menu has various difficulty ranges so that you can attempt the problems most suited to your experience*
*Popular Topics and Tags*

Like most users, Chef didn’t know that he could add problems to a personal to-do list by clicking on the magic '+' symbol on the top-right of each problem page. But once he found out about it, he went crazy and added loads of problems to his [to-do] list without looking at their difficulty rating. 

Chef is a beginner and should ideally try and solve only problems with difficulty rating strictly less than 1000. Given a list of difficulty ratings for problems in the Chef’s to-do list, please help him identify how many of those problems Chef should remove from his to-do list, so that he is only left with problems of difficulty rating less than 1000.

------ Input Format ------ 

- The first line of input will contain a single integer T, the number of test cases. Then the testcases follow.
- Each testcase consists of 2 lines of input.
- The first line of input of each test case contains a single integer, N, which is the total number of problems that the Chef has added to his to-do list.
- The second line of input of each test case contains N space-separated integers D_{1}, D_{2}, \ldots, D_{N}, which are the difficulty ratings for each problem in the to-do list.

------ Output Format ------ 

For each test case, output in a single line the number of problems that Chef will have to remove so that all remaining problems have a difficulty rating strictly less than 1000.

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$1 ≤ N ≤ 1000$
$1 ≤ D_{i} ≤ 5000$

------ subtasks ------ 

Subtask 1 (100 points):
Original constraints

----- Sample Input 1 ------ 
5
3
800 1200 900
4
999 1000 1001 1002
5
1 2 2 2 5000
5
1000 1000 1000 1000 1000
3
900 700 800

----- Sample Output 1 ------ 
1
3
1
5
0

----- explanation 1 ------ 
Test case $1$: Among the three difficulty ratings, Chef only needs to remove the problem with difficulty rating $1200$, since it is $≥ 1000$. So, the answer is $1$.

Test case $2$: Among the four difficulty ratings, Chef needs to remove the problems with difficulty ratings of $1000$, $1001$, and $1002$, since they are $≥ 1000$. So, the answer is $3$.

Test case $3$: Among the five difficulty ratings, Chef needs to remove the problem with a difficulty rating of $5000$, since it is $≥ 1000$. So, the answer is $1$.

Test case $4$: Chef needs to remove all the five problems, since they are all rated $≥ 1000$. So, the answer is $5$.

Test case $5$: Chef does not need to remove any problem, since they are all rated $< 1000$. So, the answer is $0$.

Difficulty: EASY

Solutions:
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()[:n]))
	x = 0
	for i in l:
		if i >= 1000:
			x += 1
	print(x)


n = int(input())
l1 = []
for i in range(n):
	c = 0
	p = int(input())
	l = list(map(int, input().split()))
	if len(l) == p:
		for j in l:
			if j >= 1000:
				c = c + 1
			else:
				continue
		l1.append(c)
		print(l1[i])


for i in range(int(input())):
	num = int(input())
	t1 = list(map(int, input().split()))
	count = 0
	for i in range(num):
		if t1[i] >= 1000:
			count = count + 1
			continue
	print(count)


a = int(input())
for i in range(a):
	k = int(input())
	l = list(map(int, input().split()))
	n = 0
	for i in range(k):
		if l[i] >= 1000:
			n = n + 1
		continue
	print(n)


for i in range(int(input())):
	x = int(input())
	count = 0
	a = map(int, input().split())
	for i in a:
		if i >= 1000:
			count += 1
	print(count)


t = int(input())
for i in range(t):
	c = 0
	n = int(input())
	d = list(map(int, input().split()))
	for i in d:
		if i >= 1000:
			c = c + 1
	print(c)


for i in range(int(input())):
	n = int(input())
	c = 0
	l = list(map(int, input().split()))
	for i in l:
		if i >= 1000:
			c += 1
	print(c)


T = int(input())
for i in range(T):
	N = int(input())
	D = list(map(int, input().split()))
	count = 0
	for i in range(N):
		if D[i] >= 1000:
			count = count + 1
			continue
	print(count)


t = int(input())
for i in range(t):
	n = int(input())
	k = list(map(int, input().split()))
	g = 0
	for i in k:
		if i >= 1000:
			g += 1
	print(g)


for _ in range(int(input())):
	n = int(input())
	d = list(map(int, input().split()))
	count = 0
	for element in d:
		if element >= 1000:
			count += 1
	print(count)


t = int(input())
while t:
	N = int(input())
	D = [int(i) for i in input().split()]
	for i in D:
		if i < 1000:
			N -= 1
	print(N)
	t -= 1


r = int(input())
i = 0
while i < r:
	rr = int(input())
	st1 = input()
	st = []
	count = 0
	st = st1.split(' ')
	for j in range(rr):
		if int(st[j]) >= 1000:
			count += 1
		else:
			continue
	print(count)
	i += 1


T = int(input())
c = 0
for i in range(T):
	N = int(input())
	d = list(map(int, input().split()))
	for i in d:
		if i >= 1000:
			c += 1
	print(c)
	c = 0


for t in range(int(input())):
	n = int(input())
	N = list(map(int, input().split()))
	m = [m for m in N if m < 1000]
	print(n - len(m))


for x in range(int(input())):
	l = int(input())
	c = 0
	a = list(map(int, input().split()))
	for i in a:
		if i >= 1000:
			c = c + 1
	print(c)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	count = 0
	for i in a:
		if i >= 1000:
			count += 1
			continue
	print(count)


for i in range(int(input())):
	j = int(input())
	res = 0
	lst = list(map(int, input().split()))
	for k in lst:
		if k >= 1000:
			res += 1
	print(res)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	c = 0
	for i in arr:
		if i >= 1000:
			c += 1
	print(c)


n = int(input())
for i in range(n):
	count = 0
	m = int(input())
	l = [int(i) for i in input().split()]
	for i in l:
		if i >= 1000:
			count += 1
	print(count)


n = int(input())
for i in range(n):
	m = int(input())
	q = 0
	arr = list(map(int, input().split()))
	for j in range(m):
		if arr[j] >= 1000:
			q += 1
	print(q)


T = int(input())
for i in range(T):
	count = 0
	n = int(input())
	a = input()
	a = a.split()
	for r in a:
		if int(r) >= 1000:
			count += 1
	print(count)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	sum = 0
	for j in range(n):
		if a[j] >= 1000:
			sum += 1
	print(sum)


t = int(input())
for i in range(t):
	N = int(input())
	temp = list(map(int, input().split()))
	res = 0
	for i in temp:
		if i >= 1000:
			res += 1
	print(res)


t = int(input())
for _ in range(t):
	t = int(input())
	problems = list(map(int, input().split()))
	print(len(list(filter(lambda n: n >= 1000, problems))))


t = int(input())
for i in range(t):
	a = int(input())
	b = list(map(int, input().split()))
	c = 0
	for i in b:
		if i >= 1000:
			c += 1
	print(c)


for i in range(int(input())):
	N = int(input())
	list1 = list(map(int, input().split()))
	ans = 0
	for j in range(N):
		if list1[j] >= 1000:
			ans += 1
	print(ans)


t = int(input())
while t > 0:
	n = int(input())
	rating = list(map(int, input().split()))[:n]
	ans = 0
	for r in rating:
		if r >= 1000:
			ans += 1
	print(ans)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = map(int, input().split())
	count = 0
	for i in a:
		if i >= 1000:
			count += 1
	print(count)


t = int(input())
for _ in range(t):
	a = int(input())
	lst = list(map(int, input().split()))[:a]
	count = 0
	for i in range(len(lst)):
		if lst[i] >= 1000:
			count = count + 1
	print(count)


counter = 0
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split(' ')))
	for num in arr:
		if num >= 1000:
			counter += 1
			n -= 1
	print(counter)
	counter = 0


l = []
for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	count = 0
	for i in range(len(l)):
		if l[i] >= 1000:
			count += 1
		else:
			continue
	print(count)


for i in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	l = []
	i = 0
	while i < n:
		if x[i] >= 1000:
			l.append(i)
		i = i + 1
	print(len(l))


for i in range(int(input())):
	x = int(input())
	y = list(map(int, input().split()))
	c = 0
	for j in range(x):
		if y[j] >= 1000:
			c = c + 1
	print(c)


t = int(input())
while t:
	n = int(input())
	l = list(map(int, input().split()))
	c = 0
	for i in l:
		if i >= 1000:
			c += 1
	print(c)
	t -= 1


T = int(input())
for i in range(T):
	N = int(input())
	king = list(map(int, input().split()))
	count = 0
	for kings in king:
		if kings >= 1000:
			count = count + 1
	print(count)


for i in range(int(input())):
	n = int(input())
	x = 0
	y = list(map(int, input().split()))
	for i in y:
		if i >= 1000:
			x = x + 1
	print(x)


t = int(input())
for i in range(t):
	n = int(input())
	ratings = list(map(int, input().split()))
	count = 0
	for r in ratings:
		if r >= 1000:
			count += 1
	print(count)


T = int(input())
for i in range(T):
	N = int(input())
	ratings = list(map(int, input().split()))
	count = 0
	for rating in ratings:
		if rating >= 1000:
			count += 1
	print(count)


def fun():
	for i in l:
		if i >= 1000:
			s.append(i)
	return len(s)
n = int(input())
for i in range(n):
	s = []
	t = int(input())
	l = list(map(int, input().split()))
	print(fun())


for i in range(0, int(input())):
	a = 0
	n = int(input())
	d = list(map(int, input().split()))
	for i in range(0, n):
		if d[i] >= 1000:
			a += 1
	print(a)


t = int(input())
for _ in range(t):
	n = int(input())
	ratings = list(map(int, input().split()))
	count = 0
	for rating in ratings:
		if rating >= 1000:
			count += 1
	print(count)


n = int(input())
for i in range(n):
	k = int(input())
	l = list(map(int, input().split()))
	c = 0
	for j in l:
		if j >= 1000:
			c = c + 1
		else:
			pass
	print(c)


t = int(input())
for i in range(t):
	n = int(input())
	r = input().split()
	count = 0
	for j in range(len(r)):
		if int(r[j]) >= 1000:
			count += 1
	print(count)


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


T = int(input())
for i in range(T):
	count = 0
	N = int(input())
	dn = list(map(int, input().split(' ')))
	for j in range(N):
		if dn[j] >= 1000:
			count += 1
	print(count)


t = int(input())
for _ in range(t):
	N = int(input())
	list1 = input().split()
	count = 0
	for (i, _) in enumerate(list1):
		if int(list1[i]) >= 1000:
			count += 1
	print(count)


for i in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	count = 0
	for k in li:
		if k >= 1000:
			count += 1
	print(count)


loop = int(input())
for i in range(loop):
	ctr = 0
	cool = int(input())
	x = list(map(int, input().split()))
	for j in range(0, len(x)):
		if x[j] >= 1000:
			ctr += 1
	print(ctr)


for t in range(int(input())):
	n_pr = int(input())
	dif_rat = list(map(int, input().split()))
	n_rem = [pr for pr in dif_rat if pr >= 1000]
	print(len(n_rem))