Joffrey Baratheon  is the king of all seven kingdoms. His birthday is coming very soon. So he invited all lords, ladies and kings of the all kingdoms. So Joffrey send a unique secret code X with all invitations. When any person want to attend the birthday party of the Joffrey, he/she must tell his/her secret code to the guard and guard checks that the code is valid or not. If code is valid code, person will be able to attend the party, otherwise not.

But Robb Stark is planning to kill the Joffrey. One of the soldier of the Robb Stark viewed some of the invitations and read their secret codes. So that the Robb and his soldiers will be able to enter in the party. But  Tywin Lannister; hand of the king knows that . Now Tywin Lannister wants to protect the King Joffrey.

If there are total N persons came to the party. Tywin Lannister wants to know how many soldiers are came to kill Joffrey. But Tywin don't know, how to find those soldiers. Help Tywin to protect the Joffrey.

INPUT

The first line contains the number of test cases T and for each test case second line shows N and next N line tell the secret code of each invitation.

OUPUT

Print total number of soldiers came to kill Joffrey.

Constraints:

1 ≤ T ≤ 10

1 ≤ N ≤ 100000

1 ≤ X ≤ 1000000000

SAMPLE INPUT
2
3
1 2 3
5
1 2 2 3 5

SAMPLE OUTPUT
0
1
import math
t=input()
c=0
A=[]
if t>=1 and t<=10:
    for i in range(0,t):
        n=input()
        c=0
        A=[]
        if n>=1 and n<=100000:
            s=raw_input().split()
            if len(s)==n:
                for j in range(0,len(s)):
                    k=int(s[j])
                    if k>=1 and k<=math.pow(10,9):
                        A.append(k)
                A.sort()
                for i3 in range(0,len(A)-1):
                       if(A[i3]-A[i3+1])==0:
                              c+=1
            print(c)