/* Beautiful Codes are MUCH better than 'Shorter' ones ! user : triveni date : 27/02/2018 time : 02:57:56 */ #include using namespace std; #define pii std::pair #define vi std::vector #define sz(v) (int)(v.size()) #define mp(a,b) make_pair(a,b) #define pb(a) push_back(a) #define each(it,s) for(auto it = s.begin(); it != s.end(); ++it) #define rep(i, n) for(int i = 0; i < (n); ++i) #define all(v) v.begin(), v.end() #define scan(n) scanf("%d", &n) #define scan2(n, m) scanf("%d%d", &n, &m) #define pin(n) printf("%d\n",n) #define pis(n) printf("%d ",n) #define pll(n) printf("%lld\n", n) #define X first #define Y second typedef long long ll; ll mod = 1000000007; inline int pow_(ll a, int n, int p=mod){ int r=1;while(n){if(n&1)r=r*a%p;n>>=1;a=a*a%p;}return r;} inline int inv_(int a) {return pow_(a, mod-2, mod);} inline int add(int a, int b){a+=b;if(a>=mod)a-=mod;return a;} inline void adds(int& a, int b){a+=b;if(a>=mod)a-=mod;} inline int mul(int a, int b){return a*1ll*b%mod;} inline void muls(int& a, int b){a=a*1ll*b%mod;} inline int sub(int a, int b){a-=b;if(a<0)a+=mod;return a;} int getInt(char endChar) { int x = 0; char ch = getchar(); while(ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); } assert(ch == endChar); return x; } int main() { int T = getInt('\n'); assert(1 <= T && T <= 10); while(T--) { int n = getInt('\n'); assert(1 <= n && n <= 100000); set st; rep(i, n) { int x = getInt(i+1==n?'\n':' '); assert(1 <= x && x <= 1000000000); st.insert(x); } pin(n - sz(st)); } return 0; }