#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
	#endif

	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		vector<int> x(n);
		for (int& xi : x) {
			cin >> xi;
		}
		x[n - 1]++;
		int ans = 1;
		for (int i = n - 2; i >= 0; --i) {
			if (x[i + 1] - x[i] > 1) {
				x[i]++;
				ans++;
			} else if (x[i + 1] - x[i] == 1) {
				ans++;
			}
		}
		cout << ans << '\n';
	}
	
	return 0;
}
