//
//  B.cpp
//  
//
//  Created by Salut on 2020/12/30.
//
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
 
void solve()
{
    int n;//1e5
    int x;
    int last;
    int ans=1;
    cin>>n;
    cin>>last;
    for(int i=1;i<n;i++)
    {
        cin>>x;
        if(last==x)last++,ans++;
        else if(last<x)last=x,ans++;
    }
    cout<<ans<<endl;
}
int main()
{
    int t;//1e4
    cin>>t;
    for(;t--;)
        solve();
}
