#include<bits/stdc++.h>
using namespace std;

int main(){
    int t;
    cin >> t;

    while(t){
        int arr_len=0,counter = 0;
        int arr[3] = {0};
        cin >> arr_len;

        for(int i=0;i<arr_len;++i){
            long long int input = 0;
            cin >> input;
            ++arr[input%3];
        }

        counter = arr[0] + min(arr[1],arr[2]);
        arr[1] -= min(arr[1],arr[2]);
        arr[2] -= counter - arr[0];
        counter += arr[1]/3 + arr[2]/3 ;

        cout << counter << endl;

        --t;
    }

    return 0;
}


#include<iostream>
#include<cmath>
using namespace std;

int main(){
    int t;
    cin >> t;

    while(t){
        int arr_len,counter = 0;
        int arr[3] = {};
        cin >> arr_len;

        for(int i=0;i<arr_len;++i){
            long int input = 0;
            cin >> input;
            ++arr[input%3];
        }

        counter = arr[0] + min(arr[1],arr[2]);
        arr[1] -= min(arr[1],arr[2]);
        arr[2] -= min(arr[1],arr[2]);
        counter += arr[1]/3 + arr[2]/3 ;

        cout << counter << endl;

        --t;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Maxn 4000007
const int INF = 1e9 + 5;
const int  N = 2e5 + 314;
void foo(){
    int n, ans = 0;
    cin>>n;
    vi v(n);
    map<int, int>cnt;
    for(int i = 0; i < n; i++){
        cin>>v[i];
        cnt[v[i]%3]++;
    }
    ans+=cnt[0];
    ans+=min(cnt[1], cnt[2]);
    cnt[1]-=min(cnt[1], cnt[2]);
    cnt[2]-=min(cnt[1], cnt[2]);
    ans+=cnt[1]/3+cnt[2]/3;
    cout<<ans<<"\n";
}
int main(){
    speed;
    int t;
    cin>>t;
    while(t--)foo();
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Maxn 4000007
const int INF = 1e9 + 5;
const int  N = 2e5 + 314;
void foo(){
    int n, ans = 0;
    cin>>n;
    vi cnt(4, 0);
    for(int i = 0; i < n; i++){
        int x;
        cin>>x;
        cnt[x%3]++;
    }
    ans=cnt[0];
    ans+=min(cnt[1], cnt[2]);
    int mn = min(cnt[1], cnt[2]);
    cnt[1]-=mn;
    cnt[2]-=mn;
    ans+=cnt[1]/3+cnt[2]/3;
    cout<<ans<<"\n";
}
int main(){
    speed;
    int t;
    cin>>t;
    while(t--)foo();
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Maxn 4000007
const int INF = 1e9 + 5;
const int  N = 2e5 + 314;
void foo(){
    int n, ans = 0;
    cin>>n;
    vi v(n);
    map<ll, ll>cnt;
    for(int i = 0; i < n; i++){
        cin>>v[i];
        cnt[v[i]%3]++;
    }
    ans+=cnt[0];
    ans+=min(cnt[1], cnt[2]);
    cnt[1]-=min(cnt[1], cnt[2]);
    cnt[2]-=min(cnt[1], cnt[2]);
    ans+=cnt[1]/3+cnt[2]/3;
    cout<<ans<<"\n";
}
int main(){
    speed;
    int t;
    cin>>t;
    while(t--)foo();
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Maxn 4000007
const int INF = 1e9 + 5;
const int  N = 2e5 + 314;
void foo(){
    int n, ans = 0;
    cin>>n;
    vi v(n);
    map<int, int>cnt;
    for(int i = 0; i < n; i++){
        cin>>v[i];
        cnt[v[i]%3]++;
    }
    ans+=cnt[0];
    ans+=min(cnt[1], cnt[2]);
    cnt[1]-=min(cnt[1], cnt[2]);
    ans+=cnt[1]/3;
    cout<<ans<<"\n";
}
int main(){
    speed;
    int t;
    cin>>t;
    while(t--)foo();
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Maxn 4000007
const int INF = 1e9 + 5;
const int  N = 2e5 + 314;
void foo(){
    int n, ans = 0;
    cin>>n;
    vi cnt(3);
    for(int i = 0; i < n; i++){
        int x;
        cin>>x;
        cnt[x%3]++;
    }
    ans+=cnt[0];
    ans+=min(cnt[1], cnt[2]);
    cnt[1]-=min(cnt[1], cnt[2]);
    cnt[2]-=min(cnt[1], cnt[2]);
    ans+=cnt[1]/3+cnt[2]/3;
    cout<<ans<<"\n";
}
int main(){
    speed;
    int t;
    cin>>t;
    while(t--)foo();
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Maxn 4000007
const int INF = 1e9 + 5;
const int  N = 2e5 + 314;
void foo(){
    int n, ans = 0;
    cin>>n;
    vi cnt(4, 0);
    for(int i = 0; i < n; i++){
        int x;
        cin>>x;
        cnt[x%3]++;
    }
    ans=cnt[0];
    ans+=min(cnt[1], cnt[2]);
    cnt[1]-=min(cnt[1], cnt[2]);
    cnt[2]-=min(cnt[1], cnt[2]);
    ans+=cnt[1]/3+cnt[2]/3;
    cout<<ans<<"\n";
}
int main(){
    speed;
    int t;
    cin>>t;
    while(t--)foo();
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Maxn 4000007
const int INF = 1e9 + 5;
const int  N = 2e5 + 314;
void foo(){
    int n, ans = 0;
    cin>>n;
    vi cnt(4);
    for(int i = 0; i < n; i++){
        int x;
        cin>>x;
        cnt[x%3]++;
    }
    ans=cnt[0];
    ans+=min(cnt[1], cnt[2]);
    cnt[1]-=min(cnt[1], cnt[2]);
    cnt[2]-=min(cnt[1], cnt[2]);
    ans+=cnt[1]/3+cnt[2]/3;
    cout<<ans<<"\n";
}
int main(){
    speed;
    int t;
    cin>>t;
    while(t--)foo();
}


#include<bits/stdc++.h>
using namespace std;
int a[100000];
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		long long int m,sum=0,t,k=0,k1=0;
		scanf("%lld",&m);
		for(int i=0;i<m;i++)
		{
			scanf("%lld",&t);
			t=t%3;
			if(t==0)
			sum++;
			else
			a[t]++;
		}
		sum+=min(a[1],a[2]);
		t=min(a[1],a[2]);
		a[1]=a[1]-t;
		a[2]=a[2]-t;
		k=a[1]/3;
		k1=a[2]/3;

		printf("%lld\n",sum+k+k1);
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[100000];
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		long long int m,sum=0,t,k=0,k1=0;
		scanf("%lld",&m);
		for(int i=0;i<m;i++)
		{
			scanf("%lld",&t);
			t=t%3;
			if(t==0)
			sum++;
			else
			a[t]++;
		}
		sum+=min(a[1],a[2]);
		t=min(a[1],a[2]);
		a[1]=a[1]-t;
		a[2]=a[2]-t;
		k=a[1]/3;
		k1=a[2]/3;

		printf("%lld\n",sum+min(a[1],a[2])+k+k1);
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[100000];
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		long long int m,sum=0,t;
		scanf("%lld",&m);
		for(int i=0;i<m;i++)
		{
			scanf("%lld",&t);
			t=t%3;
			if(t==0)
			sum++;
			else
			a[t]++;
		}
		int k=(a[1]-min(a[1],a[2]))/3;
		int k1=(a[2]-min(a[1],a[2]))/3;
		printf("%lld\n",sum+min(a[1],a[2])+k+k1);
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[1000000];
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		long long int m,sum=0,t;
		scanf("%lld",&m);
		for(int i=0;i<m;i++)
		{
			scanf("%lld",&t);
			t=t%3;
			if(t==0)
			sum++;
			else
			a[t]++;
		}
		printf("%lld\n",sum+min(a[1],a[2]));
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[100000];
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		long long int m,sum=0,t,k=0,k1=0;
		memset(a,0,sizeof(a));
		scanf("%lld",&m);
		for(int i=0;i<m;i++)
		{
			scanf("%lld",&t);
			t=t%3;
			if(t==0)
			sum++;
			else
			a[t]++;
		}
		t=min(a[1],a[2]);
		long long int t1=a[1]/3+a[2]/3+sum;
		sum+=min(a[1],a[2]);
		a[1]=a[1]-t;
		a[2]=a[2]-t;
		k=a[1]/3;
		k1=a[2]/3;
		printf("%lld\n",max(t1,sum+k+k1));
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[100000];
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		long long int m,sum=0,t,k=0,k1=0;
		scanf("%lld",&m);
		for(int i=0;i<m;i++)
		{
			scanf("%lld",&t);
			t=t%3;
			if(t==0)
			sum++;
			else
			a[t]++;
		}
		t=min(a[1],a[2]);
		long long int t1=a[1]/3+a[2]/3+sum;
		sum+=min(a[1],a[2]);
		a[1]=a[1]-t;
		a[2]=a[2]-t;
		k=a[1]/3;
		k1=a[2]/3;
		printf("%lld\n",max(t1,sum+k+k1));
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int i, j, n, a[10000], cnt = 0, sum = 0, t;

    scanf("%d", &t);

    for(j=1; j<=t; j++){
            scanf("%d", &n);
        for(i=0; i<n; i++){
            scanf("%d", &a[i]);

            if(a[i] == 1)
                cnt += 1;
            else if(a[i] == 2)
                cnt += 2;
            else if(a[i]%3 == 0)
                sum++;

        }
        printf("%d\n", sum+cnt/3);
        sum = 0;
        cnt = 0;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int i, j, n, a[10000], cnt = 0, sum = 0, t;

    scanf("%d", &t);

    for(j=1; j<=t; j++){
            scanf("%d", &n);
        for(i=0; i<n; i++){
            scanf("%d", &a[i]);

            if(a[i] >= 1)
                cnt += a[i];
            else if(a[i]%3 == 0)
                sum++;

        }
        printf("%d\n", sum+cnt/3);
        sum = 0;
        cnt = 0;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb push_back
#define pf printf
#define sf scanf

int main()
{
    ll n, k = 0, m, i, j, t, a;
    cin >> t;
    while(t--)
    {
        ll sum = 0, rem1 = 0, rem2 = 0, ans = 0;
        cin >> n;
        for(i = 0; i < n; i++)
        {
            cin >> a;
            if(a % 3 == 0)
                ans++;
            else if(a % 3 == 1)
                rem1++;
            else
                rem2++;
        }
        if(rem1 > rem2)
            ans += min(rem1, rem2) + (rem1 - rem2) / 3;
        else if(rem2 > rem1)
            ans += min(rem1, rem2) + (rem2 - rem1) / 3;
        else
            ans += min(rem1, rem2);

        cout << ans << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int i, j, n, a[100000], cnt = 0, sum = 0, t;

    scanf("%d", &t);

    for(j=1; j<=t; j++){
            scanf("%d", &n);
        for(i=0; i<n; i++){
            scanf("%d", &a[i]);

            if(a[i]%3 == 0)
                sum++;
            else if(a[i] >= 1 && a[i] <= 5)
                cnt += a[i];

        }
        printf("%d\n", sum+cnt/3);
        sum = 0;
        cnt = 0;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int i, j, n, a[10000], cnt = 0, sum = 0, t;

    scanf("%d", &t);

    for(j=1; j<=t; j++){
            scanf("%d", &n);
        for(i=0; i<n; i++){
            scanf("%d", &a[i]);

            if(a[i]%3 == 0)
                sum++;
            else if(a[i] >= 1)
                cnt += a[i];

        }
        printf("%d\n", sum+cnt/3);
        sum = 0;
        cnt = 0;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb push_back
#define pf printf
#define sf scanf

int main()
{
    ll n, k = 0, m, i, j, t, a;
    cin >> t;
    while(t--)
    {
        ll sum = 0, rem1 = 0, rem2 = 0, ans = 0;
        cin >> n;
        for(i = 0; i < n; i++)
        {
            cin >> a;
            if(a % 3 == 0)
                ans++;
            else if(a % 3 == 1)
                rem1++;
            else
                rem2++;
        }

        ans += min(rem1, rem2) + (rem1 - rem2) / 3;
        cout << ans << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb push_back
#define pf printf
#define sf scanf

int main()
{
    ll n, k = 0, m, i, j, t, a;
    cin >> t;
    while(t--)
    {
        ll sum = 0, rem1 = 0, rem2 = 0, ans = 0;
        cin >> n;
        for(i = 0; i < n; i++)
        {
            cin >> a;
            if(a % 3 == 0)
                ans++;
            else if(a % 3 == 1)
                rem1++;
            else
                rem2++;
        }
        if(rem1 > rem2)
            ans += min(rem1, rem2) + (rem1 - rem2) / 3;
        else
            ans += min(rem1, rem2);

        cout << ans << endl;
    }

    return 0;
}


#define _USE_MATH_DEFINES
#include <iostream>
#include <bitset>
#include <vector>
#include <map>
#include <cmath>
#include <functional>
#include <algorithm>
#include <string>
#include <set>
#include <time.h>
#include <stack>
#include <queue>
#include <sstream>

#define forn(i, n1, n2) for (int i = n1; i < n2; i++)
#define pii pair<int, int>
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define vvi vector<vi>
#define vvll vector<vll>
#define vvpii vector<vpii>
#define allR(a) a.begin(), a.end()
#define mt make_tuple

using namespace std;

const ll N = 300100, MOD = 1e9 + 7;

int main() {
	ios::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int q;
	cin >> q;
	while (q--) {
		int n;
		cin >> n;
		vi arr(3);
		while (n--) {
			int t;
			cin >> t;
			arr[t % 3]++;
		}
		int res = arr[0] + min(arr[1], arr[2]);
		int sub = min(arr[1], arr[2]);
		arr[1] -= sub;
		arr[2] -= sub;
		res += arr[1] / 3;
		cout << res << endl;
	}
}


#define _USE_MATH_DEFINES
#include <iostream>
#include <bitset>
#include <vector>
#include <map>
#include <cmath>
#include <functional>
#include <algorithm>
#include <string>
#include <set>
#include <time.h>
#include <stack>
#include <queue>
#include <sstream>

#define forn(i, n1, n2) for (int i = n1; i < n2; i++)
#define pii pair<int, int>
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define vvi vector<vi>
#define vvll vector<vll>
#define vvpii vector<vpii>
#define allR(a) a.begin(), a.end()
#define mt make_tuple

using namespace std;

const ll N = 300100, MOD = 1e9 + 7;

int main() {
	ios::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int q;
	cin >> q;
	while (q--) {
		int n;
		cin >> n;
		vi arr(3);
		while (n--) {
			int t;
			cin >> t;
			arr[t % 3]++;
		}
		int res = arr[0] + min(arr[1], arr[2]);
		int sub = min(arr[1], arr[2]);
		arr[1] -= sub;
		arr[2] -= sub;
		res += arr[1] / 3;
		res += arr[2] / 3;
		cout << res << endl;
	}
}


#include <iostream>
#pragma warning(disable : 4996)
#define endl '\n'
using namespace std;
typedef long long ll;
#include <set>
#include <vector>

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	int t;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		int n;
		int x;
		int count = 0;
		cin >> n;
		int countRem1 = 0;
		int countRem2 = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> x;
			if (x % 3 ==0)
				count++;
			else if (x % 3 == 1)
				countRem1++;
			else
				countRem2++;
		}
		if (countRem1 <= countRem2)
		{
			count += countRem1;
			countRem2 -= countRem1;
			count += countRem2 / 3;
		}
		else
		{
			count += countRem2;
			countRem1 -= countRem2;
			count += countRem1 / 3;
		}
		cout << count << endl;

	}
		return 0;
}

// fekret el mas2ala eni badayar 3ala akbar 3adad men el arkam eli divisible by 3 men 5elal eni a - merge-ha ma3 ba3d
// ay rakam bey5osh haykoun 7aga men 3 ... rem=0 ( it is divisible by 3) rem=1 && rem = 2
// wnaa bada5al law rem=0 fa hazawed el count , w ha7seb el count of numbers with rem=1 and rem=2
// kol pair of rem =1 ma3 rem=2 beyedi rakam rem=0 divisible by 3 fa ana hashouf anhi el count beta3o a2al w ha5odhom kolohom a - pair-hom ma3
// arkam tedini rem=0 ; keda haykoun ya rem=0 aw rem=1 fedi 5ales w metba2i el tani ... el tani da kol 3 meno beyetgem3o 3ala ba3d yedoun rakam rem =0;
// fa hazawed el count eli metba2i ma2soum 3ala 3 integer division


#include <iostream>
#pragma warning(disable : 4996)
#define endl '\n'
using namespace std;
typedef long long ll;
#include <set>
#include <vector>

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	int t;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		int n;
		int x;
		int count = 0;
		cin >> n;
		int countRem1 = 0;
		int countRem2 = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> x;
			if (x % 3 ==0)
				count++;
			else if (x % 3 == 1)
				countRem1++;
			else
				countRem2++;
		}
		if (countRem1 <= countRem2)
		{
			count += countRem1;
			countRem2 -= countRem1;
			count += countRem2 / 3;
		}
		else
		{
			count += countRem2;
			countRem1 -= countRem2;
			count += countRem1 / 3;
		}
		cout << count << endl;

	}
		return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	int n, t,num1, num2, sum, num;
	cin >> t;
	while (t--)
	{
		num1 = num2 = sum = 0;

		cin >> n;
		while (n--)
		{
			cin >> num;
			if (num % 3 == 0) sum += 1;
			else if (num % 3 == 1) num1 += 1;
			else num2 += 1;
		}

		if (num1 > num2)
		{
			sum += num2 + (num1 - num2) / 3;
		}
		else
		{
			sum += num1 + (num2 - num1) / 3;

		}

		cout << sum << endl;

	}

}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	int n, t,num1, num2, sum, num;
	cin >> t;
	while (t--)
	{
		num1 = num2 = sum = 0;

		cin >> n;
		while (n--)
		{
			cin >> num;
			if (num % 3 == 0) sum += 1;
			else if (num % 3 == 1) num1 += 1;
			else num2 += 1;
		}

		if (num1&&num2)
		{
			sum += min(num1, num2);
			num1 -= min(num1, num2);
		}

		if (num1 >= 3)
		{
			sum += num1 / 3;
			num1 %= 3;
		}

		cout << sum << endl;

	}

}


#include              <algorithm>
#include               <iostream>
#include                <cstring>
#include                <stdio.h>
#include                 <string>
#include                 <vector>
#include                 <time.h>
#include                  <queue>
#include                  <cmath>
#include                    <map>
#include                    <set>
using   namespace            std;
typedef	long long             vt;
typedef unsigned long long   vt2;
typedef	pair<vt,vt>          PVV;
typedef	pair<char,vt>        PCV;
typedef	pair<string, vt>     PSV;
typedef	map<vt,vt>           MVV;
typedef map<char,vt>         MCV;
typedef map<string,vt>       MSV;
#define	T true
#define F false
#define sd(x)   scanf("%d",&x)
#define sl(x)   scanf("%lld",&x)
#define ss(x)   scanf("%s",&x)
#define fi(x,y) for(int i=x;i<y;i++)
#define fj(x,y) for(int j=x;j<y;j++)
#define fk(x,y) for(int k=x;k<y;k++)
#define MAXP 2000010
const int MAXN = 2e5 + 99, INF = 0x3f3f3f3f;
const int MAXR = 1e5 + 99, MAXC = 1e5 + 99;
vt HASHprime = 13331;//7,97,997,9973,99991,999983,131,13331
////////////////////////////////////////////////////////////
vt2 fx(vt2 n)
{
	if (n % 2 == 0)
		return n / 2;
	else if (n % 3 == 0)
		return (2 * n) / 3;
	else if (n % 5 == 0)
		return (4 * n) / 5;
	else
		return -1;
}
int main()
{
	int q;
	cin >> q;
	int ai[MAXN],bi[MAXN];
	while (q--)
	{
		int n;
		cin >> n;
		int ans = 0;
		int j = 0;
		int k = 0;
		fi(0, n)
		{
			int t;
			sd(t);
			if (t % 3 == 0)
				ans++;
			else if (t % 3 == 1)
				ai[j++] = 1;
			else
				bi[k++] = 2;
		}
		if (j <= k)
		{
			ans += j;
			if(k-j!=0)
			  ans += ((k - j) / 3);
		}
		else if (j > k)
		{
			ans += k;
			ans += ((j - k) / 3);
		}
		cout << ans << endl;
	}
	return 0;
}


														//"بسم الله الرحمن الرحيم"

							//"وأما من امن وعمل صالحا فله جزاء الحسنى وسنقول له من امرنا يسرا"

													 //"tomorrow never will be like today........"

										//"Go and try to hack me you are a loooooooser anyway huh *_*........"

#include <iostream>
#include<string>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include<cmath>
#include<algorithm>
#include<functional>
#include<set>
#include<stack>
#include<queue>
#include<iomanip>
#include<math.h>

#define loop(n) for(int i=0;i<n;i++)
#define cinarr(arr,n) for(int i=0;i<n;i++){cin>>arr[i];}
#define PII pair<int , int>
#define PLL pair<long long,long long>
#define PIS pair<int , string>
#define pb(a) push_back(a)
#define veci vector<int>
#define vecl vector<long long>
#define vecs vector<string>
#define sz(s) int(s.size())
#define p(a) push(a)

const int MX = 1000000;

using namespace std;

typedef long long ll;
typedef string str;
typedef double db;
typedef float fl;
typedef int i;

int Notprime[2750131 + 5];
map<int, int> indexPrimes;
map<int, int> foundd;

void sievePrimes()
{
	Notprime[0] = 1;
	Notprime[1] = 1;
	for (int p = 2; p*p <= 2750131; p++)
	{
		// If prime[p] is not changed, then it is a prime
		if (!Notprime[p])
		{
			// Update all multiples of p greater than or
			// equal to the square of it
			// numbers which are multiple of p and are
			// less than p^2 are already been marked.
			for (int i = p * p; i <= 2750131; i += p)
				Notprime[i] = 1;
		}
	}
	int j = 1;
	loop(2750131 + 5)
	{
		if (!Notprime[i])
		{
			indexPrimes[i] = j++;
		}
	}
}

vector<int> ans;
int main()
{
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		int c0 = 0;
		int c1 = 0;
		int c2 = 0;
		loop(n)
		{
			ll x;
			cin >> x;
			if (x % 3 == 0)
				c0++;
			else if (x % 3 == 1)
				c1++;
			else
				c2++;
		}

		int ans = 0;
		ans += c0;
		if (c1 <= c2)
		{
			ans += c1;
			c1 = 0;
			c2 -= c1;
			ans += c2 / 3;
		}
		else
		{
			ans += c2;
			c2 = 0;
			c1 -= c2;
			ans += c1 / 3;
		}
		cout << ans << endl;

	}

}


														//"بسم الله الرحمن الرحيم"

							//"وأما من امن وعمل صالحا فله جزاء الحسنى وسنقول له من امرنا يسرا"

													 //"tomorrow never will be like today........"

										//"Go and try to hack me you are a loooooooser anyway huh *_*........"

#include <iostream>
#include<string>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include<cmath>
#include<algorithm>
#include<functional>
#include<set>
#include<stack>
#include<queue>
#include<iomanip>
#include<math.h>

#define loop(n) for(int i=0;i<n;i++)
#define cinarr(arr,n) for(int i=0;i<n;i++){cin>>arr[i];}
#define PII pair<int , int>
#define PLL pair<long long,long long>
#define PIS pair<int , string>
#define pb(a) push_back(a)
#define veci vector<int>
#define vecl vector<long long>
#define vecs vector<string>
#define sz(s) int(s.size())
#define p(a) push(a)

const int MX = 1000000;

using namespace std;

typedef long long ll;
typedef string str;
typedef double db;
typedef float fl;
typedef int i;

int Notprime[2750131 + 5];
map<int, int> indexPrimes;
map<int, int> foundd;

void sievePrimes()
{
	Notprime[0] = 1;
	Notprime[1] = 1;
	for (int p = 2; p*p <= 2750131; p++)
	{
		// If prime[p] is not changed, then it is a prime
		if (!Notprime[p])
		{
			// Update all multiples of p greater than or
			// equal to the square of it
			// numbers which are multiple of p and are
			// less than p^2 are already been marked.
			for (int i = p * p; i <= 2750131; i += p)
				Notprime[i] = 1;
		}
	}
	int j = 1;
	loop(2750131 + 5)
	{
		if (!Notprime[i])
		{
			indexPrimes[i] = j++;
		}
	}
}

vector<int> ans;
int main()
{
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		int c0 = 0;
		int c1 = 0;
		int c2 = 0;
		loop(n)
		{
			ll x;
			cin >> x;
			if (x % 3 == 0)
				c0++;
			else if (x % 3 == 1)
				c1++;
			else if(x%3==2)
				c2++;
		}

		int ans = 0;
		ans += c0;
		int mn = min(c1, c2);
		ans += mn;
		c1 -= mn;
		c2 -= mn;
		ans += (c1 + c2) / 3;
		cout << ans << endl;

	}

}


														//"بسم الله الرحمن الرحيم"

							//"وأما من امن وعمل صالحا فله جزاء الحسنى وسنقول له من امرنا يسرا"

													 //"tomorrow never will be like today........"

										//"Go and try to hack me you are a loooooooser anyway huh *_*........"

#include <iostream>
#include<string>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include<cmath>
#include<algorithm>
#include<functional>
#include<set>
#include<stack>
#include<queue>
#include<iomanip>
#include<math.h>

#define loop(n) for(int i=0;i<n;i++)
#define cinarr(arr,n) for(int i=0;i<n;i++){cin>>arr[i];}
#define PII pair<int , int>
#define PLL pair<long long,long long>
#define PIS pair<int , string>
#define pb(a) push_back(a)
#define veci vector<int>
#define vecl vector<long long>
#define vecs vector<string>
#define sz(s) int(s.size())
#define p(a) push(a)

const int MX = 1000000;

using namespace std;

typedef long long ll;
typedef string str;
typedef double db;
typedef float fl;
typedef int i;

int Notprime[2750131 + 5];
map<int, int> indexPrimes;
map<int, int> foundd;

void sievePrimes()
{
	Notprime[0] = 1;
	Notprime[1] = 1;
	for (int p = 2; p*p <= 2750131; p++)
	{
		// If prime[p] is not changed, then it is a prime
		if (!Notprime[p])
		{
			// Update all multiples of p greater than or
			// equal to the square of it
			// numbers which are multiple of p and are
			// less than p^2 are already been marked.
			for (int i = p * p; i <= 2750131; i += p)
				Notprime[i] = 1;
		}
	}
	int j = 1;
	loop(2750131 + 5)
	{
		if (!Notprime[i])
		{
			indexPrimes[i] = j++;
		}
	}
}

vector<int> ans;
int main()
{
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		int c0 = 0;
		int c1 = 0;
		int c2 = 0;
		loop(n)
		{
			ll x;
			cin >> x;
			if (x % 3 == 0)
				c0++;
			else if (x % 3 == 1)
				c1++;
			else if(x%3==2)
				c2++;
		}

		int ans = 0;
		ans += c0;
		if (c1 <= c2)
		{
			ans += c1;
			c1 = 0;
			c2 -= c1;
			ans += c2 / 3;
		}
		else
		{
			ans += c2;
			c2 = 0;
			c1 -= c2;
			ans += c1 / 3;
		}
		cout << ans << endl;

	}

}


#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int n,a[105],t,b[3],ans;
int main(){
	scanf("%d",&t);
	while(t--){
		ans=0;
		b[0]=0;
		b[1]=0;
		b[2]=0;
		scanf("%d",&n);
		for(int i=0;i<n;i++){
			scanf("%d",&a[i]);
			a[i]%=3;
			if(a[i]==0){
				b[0]++;
			}
			else if(a[i]==1){
				b[1]++;
			}
			else if(a[i]==2){
				b[2]++;
			}
		}
		ans+=b[0];
		int lin=min(b[1],b[2]);
		ans+=lin;
		b[1]-=lin;
		b[2]-=lin;
		int lin2=b[1]/3+b[2]/3;
		ans+=lin2;
		printf("%d\n",ans);
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
int n,a[105],t,b[3],ans;
int main(){
	scanf("%d",&t);
	while(t--){
		ans=0;
		b[0]=0;
		b[1]=0;
		b[2]=0;
		scanf("%d",&n);
		for(int i=0;i<n;i++){
			scanf("%d",&a[i]);
			a[i]%=3;
			if(a[i]==0){
				b[0]++;
			}
			else if(a[i]==1){
				b[1]++;
			}
			else if(a[i]==2){
				b[2]++;
			}
		}
		ans+=b[0];
		int lin=min(b[1],b[2]);
		ans+=lin;
		b[1]-=lin;
		b[2]-=lin;
		int lin2=b[1]/3+b[2]/3;
		ans+=lin2;
		printf("%d\n",ans);
	}
	return 0;
}


#include <iostream>
#include<map>
#include<vector>
#include<algorithm>
#include <stdio.h>
#include<set>
#include<string>
#include<math.h>
#include<cmath>
#include<iomanip>
#include<queue>
#include<stack>
#define ll long long
using namespace std;
long double pi = 3.14159265358979323846;
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int nextFit(int weight[], int n, int c)
{
	// Initialize result (Count of bins) and remaining
	// capacity in current bin.
	int res = 0, bin_rem = c;

	// Place items one by one
	for (int i = 0; i < n; i++) {
		// If this item can't fit in current bin
		if (weight[i] > bin_rem) {
			res++; // Use a new bin
			bin_rem = c - weight[i];
		}
		else
			bin_rem -= weight[i];
	}
	return res;
}

// Driver program
int main()
{
	int q; cin >> q;
	while (q--) {
		int n;  cin >> n;
		int c0=0, c1=0, c2=0;
		int z;
		for (int i = 0; i < n; i++)
		{
			cin >> z;
			c1 += (z % 3 == 1);
			c2 += (z % 3 == 2);
			c0 += (z % 3 == 0);
		}
		int c = min(c1, c2);
		c1 -= c;
		c2 -= c;
		cout << c + c0 + c1 / 3 + c2 / 3<<endl;
	}

	return 0;
}


#include <iostream>
#include<map>
#include<vector>
#include<algorithm>
#include <stdio.h>
#include<set>
#include<string>
#include<math.h>
#include<cmath>
#include<iomanip>
#include<queue>
#include<stack>
#define ll long long
using namespace std;
long double pi = 3.14159265358979323846;
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int nextFit(int weight[], int n, int c)
{
	// Initialize result (Count of bins) and remaining
	// capacity in current bin.
	int res = 0, bin_rem = c;

	// Place items one by one
	for (int i = 0; i < n; i++) {
		// If this item can't fit in current bin
		if (weight[i] > bin_rem) {
			res++; // Use a new bin
			bin_rem = c - weight[i];
		}
		else
			bin_rem -= weight[i];
	}
	return res;
}

// Driver program
int main()
{
	int q; cin >> q;
	while (q--) {
		int n;  cin >> n;
		int c0=0, c1=0, c2=0;
		int z;
		for (int i = 0; i < n; i++)
		{
			cin >> z;
			c1 += (z % 3 == 1);
			c2 += (z % 3 == 2);
			c0 += (z % 3 == 0);
		}
		int c = min(c1, c2);
		c1 -= c;
		c2 -= c;
		cout << c + c0 + c1 / 3 + (c2 * 3) / 2<<endl;
	}

	return 0;
}


#include <iostream>
#include<map>
#include<vector>
#include<algorithm>
#include <stdio.h>
#include<set>
#include<string>
#include<math.h>
#include<cmath>
#include<iomanip>
#include<queue>
#include<stack>
#define ll long long
using namespace std;
long double pi = 3.14159265358979323846;
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int nextFit(int weight[], int n, int c)
{
	// Initialize result (Count of bins) and remaining
	// capacity in current bin.
	int res = 0, bin_rem = c;

	// Place items one by one
	for (int i = 0; i < n; i++) {
		// If this item can't fit in current bin
		if (weight[i] > bin_rem) {
			res++; // Use a new bin
			bin_rem = c - weight[i];
		}
		else
			bin_rem -= weight[i];
	}
	return res;
}

// Driver program
int main()
{
	int q; cin >> q;
	while (q--) {
		int n;  cin >> n;
		int c0=0, c1=0, c2=0;
		int z;
		for (int i = 0; i < n; i++)
		{
			cin >> z;
			c1 += (z % 3 == 1);
			c2 += (z % 3 == 2);
			c0 += (z % 3 == 0);
		}
		int c = min(c1, c2);
		c1 -= c;
		c2 -= c;
		cout << c + c0 + c1 / 3 + (c2 * 3) / 3<<endl;
	}

	return 0;
}


#define _USE_MATH_DEFINES

#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

int main()
{
	int t;

	cin >> t;

	for (int i = 0; i < t; i++)
	{
		int n;

		cin >> n;

		int a, cntR[3] = { 0, 0, 0 };

		for (int j = 0; j < n; j++)
		{
			cin >> a;

			cntR[a % 3]++;
		}

		int min12 = min(cntR[1], cntR[2]);

		int ans = cntR[0] + min12;
		cntR[1] -= min12;
		cntR[2] -= min12;

		ans += cntR[1] / 3 + cntR[2] / 3;

		cout << ans << endl;
	}

	return 0;
}


#include <iostream>
using namespace std;

int main()
{

	int t, n, buf;

	cin >> t;

	for (int i = 0; i < t; i++) {
		cin >> n;
		int a[3] = { 0, 0,0 };
		for (int i = 0; i < n; i++) {
			cin >> buf;
			a[buf % 3]++;
		}

		if (a[1] == a[2]) cout << a[0] + a[1];
		else if (a[1] > a[2]) cout << a[0] + a[2] + (a[1] - a[2]) / 3;
		else cout << a[0] + a[1] + (a[2] - a[1]) / 3;
		cout << endl;
	}

	//system("pause");
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
#include<string>
#include<string.h>
#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<time.h>
#include<queue>
#include<map>
#include<limits.h>

#define vi vector<int>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double dd;

#define fast  std :: ios :: sync_with_stdio ( false )
#define pi 3.141592653589793238462643383279
#define rad 57.295779513082323
#define am &
#define sc scanf
#define scd(i) scanf("%d",am i)
#define pr printf
#define mp make_pair
#define poo(i,a,b) for(ll i=a;i<=b;i++)
#define oop(i,a,b) for(ll i=a;i>=b;i--)
using namespace std;

namespace Help
{
	ll gcd(ll a, ll b)
	{
		while (a != 0 && b != 0)
		{
			if (a > b)
				a &= b;
			else
				b %= a;
		}
		return a + b;
	}
	void Qsort(int a[], int f, int q)
	{
		int l = f, r = q, x = a[(f + q) / 2], c;

		if (f >= q) return;
		while (l <= r)
		{
			while (a[l] < x)
				l++;
			while (a[r] > x)
				r--;
			if (l <= r)
			{
				swap(a[l], a[r]);
				l++;
				r--;
			}

		}
		Qsort(a, f, r);
		Qsort(a, l, q);
	}
	void Qsort(ll a[], int f, int q)
	{
		ll l = f, r = q, x = a[(f + q) / 2], c;

		if (f >= q) return;
		while (l <= r)
		{
			while (a[l] < x)
				l++;
			while (a[r] > x)
				r--;
			if (l <= r)
			{
				swap(a[l], a[r]);
				l++;
				r--;
			}

		}
		Qsort(a, f, r);
		Qsort(a, l, q);
	}
	int binsearch(int n, int a[], int h)
	{
		int l = 0, r = h, c = n;
		while (l < r - 1)
		{
			c = (l + r) / 2;
			if (n < a[c])
				r = c;
			else l = c;
		}
		if (a[l] == n)
			return l + 1;
		else return -1;
	}
	bool isPrime(ll a)
	{
		ll i;
		if (a % 2 == 0)
			return 0;
		else
			for (i = 3; i * i <= a; i += 2)
				if (a % i == 0)
					return 0;
		return 1;
	}
};
int main()
{
	int a[3];
	int n,m,tmp,cou,l;
	scd(n);
	poo(i, 0, n - 1)
	{
		a[0] = 0;
		a[1] = 0;
		a[2] = 0;
		cou = 0;
		scd(m);
		for (int j = 0; j < m; j++)
		{
			scd(tmp);
			a[tmp % 3]++;
		}
		l = min(a[1], a[2]);
		cou += a[0] + l;
		a[1] -= l;
		a[2] -= l;
		cou += a[1] / 3 + a[2] / 3;
		printf("%d\n", cou);
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
#include<string>
#include<string.h>
#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<time.h>
#include<queue>
#include<map>
#include<limits.h>

#define vi vector<int>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double dd;

#define fast  std :: ios :: sync_with_stdio ( false )
#define pi 3.141592653589793238462643383279
#define rad 57.295779513082323
#define am &
#define sc scanf
#define scd(i) scanf("%d",am i)
#define pr printf
#define mp make_pair
#define poo(i,a,b) for(ll i=a;i<=b;i++)
#define oop(i,a,b) for(ll i=a;i>=b;i--)
using namespace std;

namespace Help
{
	ll gcd(ll a, ll b)
	{
		while (a != 0 && b != 0)
		{
			if (a > b)
				a &= b;
			else
				b %= a;
		}
		return a + b;
	}
	void Qsort(int a[], int f, int q)
	{
		int l = f, r = q, x = a[(f + q) / 2], c;

		if (f >= q) return;
		while (l <= r)
		{
			while (a[l] < x)
				l++;
			while (a[r] > x)
				r--;
			if (l <= r)
			{
				swap(a[l], a[r]);
				l++;
				r--;
			}

		}
		Qsort(a, f, r);
		Qsort(a, l, q);
	}
	void Qsort(ll a[], int f, int q)
	{
		ll l = f, r = q, x = a[(f + q) / 2], c;

		if (f >= q) return;
		while (l <= r)
		{
			while (a[l] < x)
				l++;
			while (a[r] > x)
				r--;
			if (l <= r)
			{
				swap(a[l], a[r]);
				l++;
				r--;
			}

		}
		Qsort(a, f, r);
		Qsort(a, l, q);
	}
	int binsearch(int n, int a[], int h)
	{
		int l = 0, r = h, c = n;
		while (l < r - 1)
		{
			c = (l + r) / 2;
			if (n < a[c])
				r = c;
			else l = c;
		}
		if (a[l] == n)
			return l + 1;
		else return -1;
	}
	bool isPrime(ll a)
	{
		ll i;
		if (a % 2 == 0)
			return 0;
		else
			for (i = 3; i * i <= a; i += 2)
				if (a % i == 0)
					return 0;
		return 1;
	}
};
int main()
{
	int a[3];
	int n,m,tmp,cou,l;
	scd(n);
	poo(i, 0, n - 1)
	{
		a[0] = 0;
		a[1] = 0;
		a[2] = 0;
		cou = 0;
		scd(m);
		for (int i = 0; i < m; i++)
		{
			scd(tmp);
			a[tmp % 3]++;
		}
		l = min(a[1], a[2]);
		cou += a[0] + l;
		a[1] -= l;
		a[2] -= l;
		cou += a[1] / 3 + a[2] / 3;
		printf("%d\n", cou);
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
#include<string>
#include<string.h>
#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<time.h>
#include<queue>
#include<map>
#include<limits.h>

#define vi vector<int>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double dd;

#define fast  std :: ios :: sync_with_stdio ( false )
#define pi 3.141592653589793238462643383279
#define rad 57.295779513082323
#define am &
#define sc scanf
#define scd(i) scanf("%d",am i)
#define pr printf
#define mp make_pair
#define poo(i,a,b) for(ll i=a;i<=b;i++)
#define oop(i,a,b) for(ll i=a;i>=b;i--)
using namespace std;

namespace Help
{
	ll gcd(ll a, ll b)
	{
		while (a != 0 && b != 0)
		{
			if (a > b)
				a &= b;
			else
				b %= a;
		}
		return a + b;
	}
	void Qsort(int a[], int f, int q)
	{
		int l = f, r = q, x = a[(f + q) / 2], c;

		if (f >= q) return;
		while (l <= r)
		{
			while (a[l] < x)
				l++;
			while (a[r] > x)
				r--;
			if (l <= r)
			{
				swap(a[l], a[r]);
				l++;
				r--;
			}

		}
		Qsort(a, f, r);
		Qsort(a, l, q);
	}
	void Qsort(ll a[], int f, int q)
	{
		ll l = f, r = q, x = a[(f + q) / 2], c;

		if (f >= q) return;
		while (l <= r)
		{
			while (a[l] < x)
				l++;
			while (a[r] > x)
				r--;
			if (l <= r)
			{
				swap(a[l], a[r]);
				l++;
				r--;
			}

		}
		Qsort(a, f, r);
		Qsort(a, l, q);
	}
	int binsearch(int n, int a[], int h)
	{
		int l = 0, r = h, c = n;
		while (l < r - 1)
		{
			c = (l + r) / 2;
			if (n < a[c])
				r = c;
			else l = c;
		}
		if (a[l] == n)
			return l + 1;
		else return -1;
	}
	bool isPrime(ll a)
	{
		ll i;
		if (a % 2 == 0)
			return 0;
		else
			for (i = 3; i * i <= a; i += 2)
				if (a % i == 0)
					return 0;
		return 1;
	}
};
int main()
{
	int a[3];
	int n,m,tmp,cou,l;
	scd(n);
	poo(i, 0, n - 1)
	{
		a[0] = 0;
		a[1] = 0;
		a[2] = 0;
		cou = 0;
		scd(m);
		for (int j = 0; j < m; i++)
		{
			scd(tmp);
			a[tmp % 3]++;
		}
		l = min(a[1], a[2]);
		cou += a[0] + l;
		a[1] -= l;
		a[2] -= l;
		cou += a[1] / 3 + a[2] / 3;
		printf("%d\n", cou);
	}
	return 0;
}


#include<stdio.h>
#include<queue>
#include<functional>
#include<vector>
#include<algorithm>

#define ll long long

using namespace std;

int main(void)
{
	int q;
	scanf("%d", &q);
	int i;
	for (i = 0; i < q; i++)
	{
		int n;
		scanf("%d", &n);
		int j;

		int answ = 0;
		int arr[3] = { 0, };
		for (j = 0; j < n; j++)
		{
			int val;
			scanf("%d", &val);
			val = val % 3;
			arr[val]++;
		}

		answ = arr[0];
		if (arr[1] > arr[2])
		{
			answ += (min(arr[1], arr[2]));
			int left = arr[1] - arr[2];
			answ += (left / 3);
		}
		else {
			answ += (min(arr[1], arr[2]));
		}

		printf("%d\n", answ);
	}
	return 0;
}


#include<stdio.h>
#include<queue>
#include<functional>
#include<vector>
#include<algorithm>

#define ll long long

using namespace std;

int main(void)
{
	int q;
	scanf("%d", &q);
	int i;
	for (i = 0; i < q; i++)
	{
		int n;
		scanf("%d", &n);
		int j;

		int answ = 0;
		int arr[3] = { 0, };
		for (j = 0; j < n; j++)
		{
			int val;
			scanf("%d", &val);
			val = val % 3;
			arr[val]++;
		}

		answ = arr[0];
		if (arr[1] > arr[2])
		{
			answ += (min(arr[1], arr[2]));
			int left = arr[1] - arr[2];
			answ += (left / 3);
		}
		else {
			answ += (min(arr[1], arr[2]));
			int left = arr[2] - arr[1];
			answ += (left / 3);
		}

		printf("%d\n", answ);
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <cstring>
#include <vector>
#include <map>
#include <iterator>
#include <cstdlib>
#include <set>
#include <utility>
#include <queue>
#include <cctype>
//#define M_PI
using namespace std;

//vector<long long int>mas;

typedef long long int ll;
typedef unsigned long long int ulli;
typedef vector<long long int> vll;
typedef vector<int> vi;
typedef vector<long long int> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long int>> vvll;
typedef map<int, int> mpi;
typedef vector<vector<char>> vvc;
typedef multimap<int, int > mmpi;
typedef set<int> sti;
typedef multiset<int> msti;

int main()
{
#ifdef _DEBUG
	freopen("input.in", "r", stdin);
	freopen("output.in", "w", stdout);
#else
	//freopen("ladder.in", "r", stdin);
	//freopen("ladder.out", "w", stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	int q;
	cin >> q;
	while (q--)
	{
		int a,n,ans=0,cnt1=0,cnt2=0;
		cin >> n;
		vi mas(n);
		set<int> ms;
		for (int i = 0; i < n; i++)
		{
			cin >> a;
			if (a % 3 != 0)
			{
				mas[i] = a;
				if (a % 3 != 2)
					cnt2++;
				else
					cnt1++;
			}
			else
				ans++;
		}
		ans += min(cnt2, cnt1) + (max(cnt2, cnt1) - min(cnt2, cnt1))/3;
		cout << ans << '\n';

	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <cstring>
#include <vector>
#include <map>
#include <iterator>
#include <cstdlib>
#include <set>

using namespace std;

vector<long long int>mas;
int answer;
int rec(long long n,int value)
{
	if (n == 1) return value;
	if (n%2==0)
		answer=rec(n / 2,value+1);
	else
	if (n%3==0)
		answer = min(answer,rec(2 * n / 3, value + 1));
	else
	if (n % 5 == 0)
		answer = min(answer, rec(4 * n / 5, value + 1));
	else
		return -1;
	return answer;
}

int main()
{
#ifdef _DEBUG
	freopen("input.in", "r", stdin);
	freopen("output.in", "w", stdout);
#else
	//freopen("ladder.in", "r", stdin);
	//freopen("ladder.out", "w", stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	int t;
	cin >> t;
	int n,k=0;
	long long int a;
	multiset<long long int> tr;
	for (int i = 0; i < t; i++)
	{
		k = 0;
		cin >> n;
		for (int j = 0; j < n; j++)
		{
			cin >> a;
			if (a % 3 != 0)
				tr.insert(a);
			else
				k++;
		}
		multiset<long long int> ::iterator it = tr.begin();
		multiset<long long int> ::iterator it2 = tr.begin();
		for (; it2 != tr.end(); it2++)
		{
			for (; it != tr.end(); it++)
			{
				if ((*it2 + *(it)) % 3 == 0)
				{
					k++;
					tr.erase(it2);
					tr.erase(it);
					it = tr.begin();
					it2 = tr.begin();
				}
			}
		}
		it = tr.begin();
		it2 = tr.begin();
		multiset<long long int> ::iterator it3 = tr.begin();
		for (; it2 != tr.end(); it2++)
		{
			for (it++=it2; it != tr.end(); it++)
			{
				for (it3++ = it; it3 != tr.end();it3++)
				if ((*it2 + *(it)+*(it3)) % 3 == 0 &&(it!=it2&&it!=it3))
				{
					{
						k++;
						tr.erase(it2);
						tr.erase(it);
						tr.erase(it3);
						it = tr.begin();
						it2 = tr.begin();
						it3 = tr.begin();
					}
				}
			/*	else
				if (it2 != it)
				{
					tr.insert((*it2 + *(it)));
					tr.erase(it2);
					tr.erase(it);
					it = tr.begin();
					it2 = tr.begin();
				}*/
			}
		}
		cout << k<<"\n";
	}
	return 0;
}


import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        int n = console.nextInt(), c = console.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
          array[i] = console.nextInt();
        }
        int num = 1;
        for (int i = 0; i < n-1; i++) {
          if (array[i+1] - array[i] <= c) {
            num++;
          } else {
            num = 1;
          }
        }
        System.out.println(num);
    }
}


import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.lang.Math;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt(), c = sc.nextInt();
		int preview = 0, current, w = 0;
		for(int i = 0; i<t; i++) {
			current = sc.nextInt();
			if(current - preview > c)
				w = 1;
			else
				w++;
			preview = current;
		}
		System.out.println(w);
		sc.close();
	}
}


import java.util.*;

public class div {
    private static Scanner sc = new Scanner(System.in);
    private static Map<Character, Integer> m = new HashMap<>();
    private static List<Integer> l = new ArrayList<>();
    private static int sum = 0;

    public static void main(String[] args) {
        int n = sc.nextInt();
        long c = sc.nextLong();

        // boolean f = true;

        long dp[] = new long[n + 1];

        for (int i = 1; i < n + 1; i++) {
            dp[i] = sc.nextLong();
        }

        for (int i = 1; i < n + 1; i++) {
            if (Math.abs(dp[i] - dp[i - 1]) <= c){
                sum++;
            } else {
                sum = 1;
            }
        }

          System.out.println(sum);

    }
}


import java.util.Scanner;

public class Q
{
    public static void main(String[] args)
    {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.nextLine();
        int[] arr = new int[a];
        for (int i = 0; i < a; i++)
            arr[i] = scanner.nextInt();
        int counter = 0;
        for(int i = 0; i < a - 1; i++)
        {
            if(Math.abs(arr[i] - arr[i + 1]) > b)
            {
                counter = 0;
            }
            else
            {
                counter++;
            }
        }
        System.out.println(counter + 1);

    }

}


import java.io.*;
import java.util.*;

public class CrazyComputer
{
	public static void main(String[] args) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int numofwords = Integer.parseInt(st.nextToken());
		int delaysecond = Integer.parseInt(st.nextToken());
		int remainingword = 0;

		st = new StringTokenizer(br.readLine());
		int lastsecondtypeat = 0;
            for(int i=0; i<numofwords; i++)
            {
                  int typeatnthsecond = Integer.parseInt(st.nextToken());
                  remainingword++;
                  if(typeatnthsecond-lastsecondtypeat>delaysecond)
                        remainingword = 1;
                  lastsecondtypeat = typeatnthsecond;
            }
            System.out.println(remainingword);
	}
}


import java.io.*;
import java.sql.Array;
import java.util.*;

public class test {
	/*
	 * array list
	 *
	 * ArrayList<Integer> al=new ArrayList<>(); creating BigIntegers
	 *
	 * BigInteger a=new BigInteger(); BigInteger b=new BigInteger();
	 *
	 * hash map
	 *
	 * HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>(); for(int
	 * i=0;i<ar.length;i++) { Integer c=hm.get(ar[i]); if(hm.get(ar[i])==null) {
	 * hm.put(ar[i],1); } else { hm.put(ar[i],++c); } }
	 *
	 * while loop
	 *
	 * int t=sc.nextInt(); while(t>0) { t--; }
	 *
	 * array input
	 *
	 * int n = sc.nextInt(); int ar[] = new int[n]; for (int i = 0; i < ar.length;
	 * i++) { ar[i] = sc.nextInt(); }
	 */

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static class Pair {
		int first, second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}

	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i] + " ");
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

	}

	private static final Scanner sc = new Scanner(System.in);
	private static final FastReader fs = new FastReader();
	private static final OutputWriter op = new OutputWriter(System.out);

	public static void main(String[] args) {
		int n = sc.nextInt();
		int x = sc.nextInt();
		long ar[] = new long[n];
		for (int i = 0; i < n; i++) {
			ar[i] = sc.nextLong();
		}
		long c = 0;
		if (n > 1) {
			for (int i = n - 1; i >= 0; i--) {
				if (ar[i] - ar[i - 1] <= x) {
					++c;
				} else {
					break;
				}
			}
		}
		++c;
		op.print(c);
		op.flush();
		op.close();
	}

}/* till here */


import java.io.*;
import java.sql.Array;
import java.util.*;

public class test {
	/*
	 * array list
	 *
	 * ArrayList<Integer> al=new ArrayList<>(); creating BigIntegers
	 *
	 * BigInteger a=new BigInteger(); BigInteger b=new BigInteger();
	 *
	 * hash map
	 *
	 * HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>(); for(int
	 * i=0;i<ar.length;i++) { Integer c=hm.get(ar[i]); if(hm.get(ar[i])==null) {
	 * hm.put(ar[i],1); } else { hm.put(ar[i],++c); } }
	 *
	 * while loop
	 *
	 * int t=sc.nextInt(); while(t>0) { t--; }
	 *
	 * array input
	 *
	 * int n = sc.nextInt(); int ar[] = new int[n]; for (int i = 0; i < ar.length;
	 * i++) { ar[i] = sc.nextInt(); }
	 */

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static class Pair {
		int first, second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}

	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i] + " ");
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

	}

	private static final Scanner sc = new Scanner(System.in);
	private static final FastReader fs = new FastReader();
	private static final OutputWriter op = new OutputWriter(System.out);

	public static void main(String[] args) {
		int n = sc.nextInt();
		int x = sc.nextInt();
		long ar[] = new long[n];
		for (int i = 0; i < n; i++) {
			ar[i] = sc.nextLong();
		}
		long c = 0;
		if (n > 1) {
			for (int i = n - 1; i >= 1; i--) {
				if (ar[i] - ar[i - 1] <= x) {
					++c;
				} else {
					break;
				}
			}
		}
		++c;
		op.print(c);
		op.flush();
		op.close();
	}

}/* till here */


import java.io.*;
import java.sql.Array;
import java.util.*;

public class test {
	/*
	 * array list
	 *
	 * ArrayList<Integer> al=new ArrayList<>(); creating BigIntegers
	 *
	 * BigInteger a=new BigInteger(); BigInteger b=new BigInteger();
	 *
	 * hash map
	 *
	 * HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>(); for(int
	 * i=0;i<ar.length;i++) { Integer c=hm.get(ar[i]); if(hm.get(ar[i])==null) {
	 * hm.put(ar[i],1); } else { hm.put(ar[i],++c); } }
	 *
	 * while loop
	 *
	 * int t=sc.nextInt(); while(t>0) { t--; }
	 *
	 * array input
	 *
	 * int n = sc.nextInt(); int ar[] = new int[n]; for (int i = 0; i < ar.length;
	 * i++) { ar[i] = sc.nextInt(); }
	 */

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static class Pair {
		int first, second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}

	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i] + " ");
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

	}

	private static final Scanner sc = new Scanner(System.in);
	private static final FastReader fs = new FastReader();
	private static final OutputWriter op = new OutputWriter(System.out);

	public static void main(String[] args) {
		int n = sc.nextInt();
		int x = sc.nextInt();
		long ar[] = new long[n];
		for (int i = 0; i < n; i++) {
			ar[i] = sc.nextLong();
		}
		long c = 0;

		for (int i = n - 1; i >= 1; i--) {
			if (ar[i] - ar[i - 1] <= x) {
				++c;
			} else {
				break;
			}
		}

		++c;
		System.out.println(c);
	}

}/* till here */


import java.io.*;
import java.sql.Array;
import java.util.*;

public class test {
	/*
	 * array list
	 *
	 * ArrayList<Integer> al=new ArrayList<>(); creating BigIntegers
	 *
	 * BigInteger a=new BigInteger(); BigInteger b=new BigInteger();
	 *
	 * hash map
	 *
	 * HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>(); for(int
	 * i=0;i<ar.length;i++) { Integer c=hm.get(ar[i]); if(hm.get(ar[i])==null) {
	 * hm.put(ar[i],1); } else { hm.put(ar[i],++c); } }
	 *
	 * while loop
	 *
	 * int t=sc.nextInt(); while(t>0) { t--; }
	 *
	 * array input
	 *
	 * int n = sc.nextInt(); int ar[] = new int[n]; for (int i = 0; i < ar.length;
	 * i++) { ar[i] = sc.nextInt(); }
	 */

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static class Pair {
		int first, second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}

	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i] + " ");
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

	}

	private static final Scanner sc = new Scanner(System.in);
	private static final FastReader fs = new FastReader();
	private static final OutputWriter op = new OutputWriter(System.out);

	public static void main(String[] args) {
		int n = sc.nextInt();
		int x = sc.nextInt();
		long ar[] = new long[n];
		for (int i = 0; i < n; i++) {
			ar[i] = sc.nextLong();
		}
		long c = 0;
		if (n > 1) {
			for (int i = n - 1; i >= 1; i--) {
				if (ar[i] - ar[i - 1] <= x) {
					++c;
				} else {
					break;
				}
			}
		}
		++c;
		System.out.println(c);
	}

}/* till here */


import java.io.*;
import java.sql.Array;
import java.util.*;

public class test {
	/*
	 * array list
	 *
	 * ArrayList<Integer> al=new ArrayList<>(); creating BigIntegers
	 *
	 * BigInteger a=new BigInteger(); BigInteger b=new BigInteger();
	 *
	 * hash map
	 *
	 * HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>(); for(int
	 * i=0;i<ar.length;i++) { Integer c=hm.get(ar[i]); if(hm.get(ar[i])==null) {
	 * hm.put(ar[i],1); } else { hm.put(ar[i],++c); } }
	 *
	 * while loop
	 *
	 * int t=sc.nextInt(); while(t>0) { t--; }
	 *
	 * array input
	 *
	 * int n = sc.nextInt(); int ar[] = new int[n]; for (int i = 0; i < ar.length;
	 * i++) { ar[i] = sc.nextInt(); }
	 */

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static class Pair {
		int first, second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}

	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]+" ");
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

	}

	private static final Scanner sc = new Scanner(System.in);
	private static final FastReader fs = new FastReader();
	private static final OutputWriter op = new OutputWriter(System.out);

	public static void main(String[] args) {
		int n = sc.nextInt();
		int x=sc.nextInt();
		long ar[] = new long[n];
		for(int i=0;i<n;i++)
		{
			ar[i]=sc.nextLong();
		}
		long c=0;
		for(int i=n-1;i>=0;i--)
		{
			if(ar[i]-ar[i-1]<=x)
			{
				++c;
			}
			else
			{
				break;
			}
		}
		++c;
		op.print(c);
		op.flush();
		op.close();
	}

}/* till here */


import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class CodeChef
{

	public static void main(String[] args) throws IOException
	{
		Scanner scan = new Scanner(System.in);
    	int n = scan.nextInt();
    	int time = scan.nextInt();
    	int first=scan.nextInt();
    	int word=1;
    	for(int i=1; i<n; i++)
    	{
    		int second = scan.nextInt();
    		++word;
    		if(second-first<=time) {
    			first=second;
//    			System.out.println("Here");
    		}
    		else
    		{
    			first=second;
    			word=1;
    		}
    	}
    	System.out.println(word);
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner in=new Scanner(System.in);
		long n=in.nextLong();
		long t=in.nextLong();
		long a[]=new long[(int)n];
		for(long i=0;i<n;i++){
			a[(int)i]=in.nextLong();
		}
		long count=1;

		for(int i=1;i<n;i++){
			long u=Math.abs(a[i]-a[i-1]);
			if(u>t){
				count=1;
			}
			else{
				count++;
			}

		}
		System.out.println(count);

	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class CrazyComputer {

    public static void main(String[] args) {
        ArrayList<Integer> arr=new ArrayList<Integer>();
        int n,c;
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        c=sc.nextInt();

        for(int i=0;i<n;i++)
        {
            arr.add(sc.nextInt());
        }
        int val=0;
        int count=0;
        for(int i=1;i<n;i++)
        {
            val=arr.get(i)-arr.get(i-1);
            if(val>c)
                count=0;
            else
                count++;
        }

        System.out.println(count+1);

    }

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	long long n,c,i,s[200001],ans=1,a=1 ;
	cin >> n >> c ;
	for ( i = 1 ; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 2 ; i <= n ; i++ )
	{
		if ( s[i] - s[i-1 ] > c ) { a = max(a,ans) ; ans = 1 ;}
		else { ans++ ; }
	}
	cout << max(a,ans) ;
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	int n,i,ans=0,s[10000],k,j;
	cin >> n >> k ;
	for ( i = 1; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 1; i <= n ; i++ )
	{
		int x = s[i] ;
		int d = 1;
		j = i+1 ;
		while ( j <= n )
		{
			if ( s[j] - x > k ) break ;
			x = s[j] ;
			j++ ;
			d++ ;
		}
		ans = max(ans,d) ;
	}
	cout << ans ;

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	long long n,c,i,s[200001],ans=1,a=1 ;
	cin >> n >> c ;
	for ( i = 1 ; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 2 ; i <= n ; i++ )
	{
		if ( s[i] - s[i-1 ] > c ) { a = ans ; ans = 1 ;}
		else { ans++ ; }
	}
	cout << max(a,ans) ;
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	long long n,c,i,s[200001],ans=1,a=1 ;
	cin >> n >> c ;
	for ( i = 1 ; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 2 ; i <= n ; i++ )
	{
		if ( s[i] - s[i-1 ] > c ) {ans=1 ;}
		else { ans++ ; }
	}
	cout << ans ;
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	long long n,c,i,s[10000],ans=1,a=1 ;
	cin >> n >> c ;
	for ( i = 1 ; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 2 ; i <= n ; i++ )
	{
		if ( s[i] - s[i-1 ] > c ) { a = max(a,ans) ; ans = 1 ;}
		else { ans++ ; }
	}
	cout << max(a,ans) ;
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	long long  n,i,ans=0,s[100001],k,j;
	cin >> n >> k ;
	for ( i = 1; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 1; i <= n ; i++ )
	{
		long long  x = s[i] ;
		long long  d = 1;
		j = i+1 ;
		while ( j <= n )
		{
			if ( s[j] - x > k ) {break ; }
			x = s[j] ;
			j++ ;
			d++ ;
		}
		ans = max(ans,d) ;
	}
	cout << ans ;

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	int n,i,ans=0,s[10000],k,j;
	cin >> n >> k ;
	for ( i = 1; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 1; i <= n ; i++ )
	{
		int x = s[i] ;
		int d = 0 ;
		j = i+1 ;
		while ( s[j] - x <= k)
		{
			x = s[j] ;
			j++ ;
			d++ ;
		}
		ans = max(ans,d) ;
	}
	cout << ans ;

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	long long n,c,i,s[200001],ans=1,a=1 ;
	cin >> n >> c ;
	for ( i = 1 ; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 2 ; i <= n ; i++ )
	{
		if ( s[i] - s[i-1 ] > c ) { a = ans ; ans = 1 ;}
		else { ans++ ; }
	}
	cout << a ;
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	long long  n,i,ans=0,s[100001],k,j;
	cin >> n >> k ;
	for ( i = 1; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 1; i <= n ; i++ )
	{
		long long  x = s[i] ;
		long long  d = 1;
		j = i+1 ;
		while ( j <= n )
		{
			if ( s[j] - x > k ) break ;
			x = s[j] ;
			j++ ;
			d++ ;
		}
		ans = max(ans,d) ;
	}
	cout << ans ;

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	int n,i,ans=0,s[200001],k,j;
	cin >> n >> k ;
	for ( i = 1; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 1; i <= n ; i++ )
	{
		int x = s[i] ;
		int d = 1;
		j = i+1 ;
		while ( j <= n )
		{
			if ( s[j] - x > k ) break ;
			x = s[j] ;
			j++ ;
			d++ ;
		}
		ans = max(ans,d) ;
	}
	cout << ans ;

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	int n,i,ans=0,s[10000],k,j;
	cin >> n >> k ;
	for ( i = 1; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 1; i <= n ; i++ )
	{
		int x = s[i] ;
		int d = 1;
		j = i+1 ;
		while ( s[j] - x <= k)
		{
			x = s[j] ;
			j++ ;
			d++ ;
		}
		ans = max(ans,d) ;
	}
	cout << ans ;

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	long long  n,i,ans=0,s[10000],k,j;
	cin >> n >> k ;
	for ( i = 1; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 1; i <= n ; i++ )
	{
		long long  x = s[i] ;
		long long  d = 1;
		j = i+1 ;
		while ( j <= n )
		{
			if ( s[j] - x > k ) break ;
			x = s[j] ;
			j++ ;
			d++ ;
		}
		ans = max(ans,d) ;
	}
	cout << ans ;

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
	long long n,c,i,s[10000],ans=1,a=1 ;
	cin >> n >> c ;
	for ( i = 1 ; i <= n ; i++ ) cin >> s[i] ;
	for ( i = 2 ; i <= n ; i++ )
	{
		if ( s[i] - s[i-1 ] > c ) { a = max(a,ans) ; ans = 1 ;}
		else { ans++ ; }
	}
	cout << a ;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   long long n,t,cnt=0,arr[100000];
   cin>>n>>t;
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++){
        (arr[i+1]-arr[i])<=t? cnt++:cnt=0;
       //if((arr[i+1]-arr[i])<=t) cnt++;
        //else cnt=0;
    }
    cout<<cnt<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   long long n,t,cnt=1,arr[100000],b=0;
   cin>>n>>t;
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n-1;i++){
            b=(arr[i+1]-arr[i]);
        b<=t? cnt++:cnt=1;
       //if(b<=t) cnt++;
        //else cnt=1;
    }
    cout<<cnt<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   long long n,t,cnt=0,arr[100000],b=0;
   cin>>n>>t;
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++){
            b=(arr[i+1]-arr[i]);
        //b<=t? cnt++:cnt=0;
       if((arr[i+1]-arr[i])<=t) cnt++;
        else cnt=0;
    }
    cout<<cnt<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   long long n,t,cnt=0,arr[100000],b=0;
   cin>>n>>t;
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++){
            b=(arr[i+1]-arr[i]);
        b<=t? cnt++:cnt=0;
       //if((arr[i+1]-arr[i])<=t) cnt++;
        //else cnt=0;
    }
    cout<<cnt<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   long long n,t,cnt=0,arr[100000],b=0;
   cin>>n>>t;
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++){
            b=(arr[i+1]-arr[i]);
        //b<=t? cnt++:cnt=0;
       if(b<=t) cnt++;
        else cnt=0;
    }
    cout<<cnt<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int l,r;
    cin>>l>>r;
    if(l%2!=0) l++;
    (r-l)<=1 ? cout<<"-1 ":cout<<l<<" "<<l+1<<" "<<l+2<<" ";
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(), v.end()
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define ff first
#define ss second
const int N=100005;
void solve()
{
    int n,k=0,val=0,m=0,i=0,j=0,l=-1,x,y,z;
    ll ans=0;
    int a[100005]={};
    cin>>n>>m;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        if(i&&a[i]-a[i-1]>m)
            j=i;
    }
    cout<<n-j;
}
int main()
{
    ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif
    int t=1;
    //cin>>t;
    while(t--)solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(), v.end()
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define ff first
#define ss second
const int N=100005;
void solve()
{
    int n,k=0,val=0,m=0,i=0,j=0,l=-1,x,y,z;
    ll ans=0;
    string s;
    cin>>n;
    j=1;
    int a[100005]={};
    cin>>n>>m;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        if(i and a[i]-a[i-1]>m)
        j=i;
    }
    cout<<n-j+1;

}
int main()
{
    ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif
    int t=1;
    //cin>>t;
    while(t--)solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(), v.end()
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define ff first
#define ss second
const int N=100005;
void solve()
{
    int n,k=0,val=0,m=0,i=0,j=0,l=-1,x,y,z;
    ll ans=0;
    string s;
    cin>>n;
    int a[100005]={};
    cin>>n>>m;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        if(i and a[i]-a[i-1]>m)
        j=i;
    }
    cout<<n-j+1;

}
int main()
{
    ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif
    int t=1;
    //cin>>t;
    while(t--)solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(), v.end()
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define ff first
#define ss second
const int N=100005;
void solve()
{
    int n,k=0,val=0,m=0,i=0,j=0,l=-1,x,y,z;
    ll ans=0;
    string s;
    j=1;
    int a[100005]={};
    cin>>n>>m;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        if(i&&a[i]-a[i-1]>m)
            j=i;
    }
    cout<<n-j;
}
int main()
{
    ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif
    int t=1;
    //cin>>t;
    while(t--)solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
        long long int i,j,k;
        long long int n,c,count=0;

        cin>>n>>c;
        long long int a[n];

        for(i=0;i<n;i++)
            cin>>a[i];

        for(i=0;i<n-1;i++)
        {
                if(a[i+1]-a[i]>c)
                    count=0;
                else
                    count++;
        }

        cout<<count+1;

        return 0;
}


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define w(x) cerr<< #x << x << endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
typedef long long int ll;
typedef vector <int> vi;
int main(){
	vi contenedor;
	int n,ans;ll it,c,t,anterior=0,resta;
	cin>>n>>c;
	while(n--){
		cin>>t;
		//w(t);
		contenedor.emplace_back(t);
	}

	if(contenedor.size()==1) cout<<1;
	else{
		rep(i,0,contenedor.size()){
			resta=contenedor[i]-anterior;
			ans++;
			if(resta>c) ans=0;
			//cout<<""<<anterior<<" "<<contenedor[i];
			anterior=contenedor[i];

		}
		cout<<++ans;
	}

}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;

	cin>>n>>c;
	ll contenedor[n];
	rep(i,0,n){
		cin>>contenedor[i];
	}

	if(n==1) cout<<1;
	else{
		rep(i,0,n-1){
			//resta=contenedor[i]-anterior;
			//ans++;
			if(contenedor[i+1]-contenedor[i]>c) ans=0;
			else ans++;
			//cout<<""<<anterior<<" "<<contenedor[i];
			//anterior=contenedor[i];

		}
		cout<<ans+1;
	}

}


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define w(x) cerr<< #x << x << endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
typedef long long int ll;
typedef vector <int> vi;
int main(){
	vi contenedor;
	int n,ans;ll it,c,t,anterior=0,resta;
	cin>>n>>c;
	while(n--){
		cin>>t;
		//w(t);
		contenedor.emplace_back(t);
	}

	if(contenedor.size()==1) cout<<1;
	else{
		rep(i,0,contenedor.size()-1){
			resta=contenedor[i]-anterior;
			ans++;
			if(resta>c) ans=0;
			//cout<<""<<anterior<<" "<<contenedor[i];
			anterior=contenedor[i];

		}
		cout<<++ans;
	}

}


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define w(x) cerr<< #x << x << endl;
#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;

	cin>>n>>c;
	ll contenedor[n];
	rep(i,0,n){
		cin>>contenedor[i];
	}

	if(n==1) cout<<1;
	else{
		rep(i,0,n){
			resta=contenedor[i]-anterior;
			ans++;
			if(resta>c) ans=0;
			//cout<<""<<anterior<<" "<<contenedor[i];
			anterior=contenedor[i];

		}
		cout<<++ans;
	}

}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;

	cin>>n>>c;
	ll contenedor[n];
	rep(i,0,n-1){
		cin>>contenedor[i];
	}

	if(n==1) cout<<1;
	else{
		rep(i,0,n-1){
			resta=contenedor[i]-anterior;
			ans++;
			anterior=contenedor[i];
			if(resta>c) ans=0;

		}
		cout<<++ans;
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;

	cin>>n>>c;
	ll contenedor[n];
	rep(i,0,n){
		cin>>contenedor[i];
	}

	if(n==1) cout<<1;
	else{
		rep(i,0,n-1){
			//resta=contenedor[i]-anterior;
			//ans++;
			if(contenedor[i+1]-contenedor[i]>c) ans=0;
			else ans++;
			//cout<<""<<anterior<<" "<<contenedor[i];
			//anterior=contenedor[i];

		}
		cout<<++ans;
	}

}


#include <bits/stdc++.h>
using namespace std;
//#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;
	ll i;
	cin>>n>>c;
	ll contenedor[n];
	for(i=0;i<n;i++){
		cin>>contenedor[i];
	}

	if(n==1) cout<<1;
	else{
		for(i=0;i<n;i++){
			resta=contenedor[i]-anterior;
			ans++;
			anterior=contenedor[i];
			if(resta>c) ans=0;

		}
		cout<<++ans;
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define w(x) cerr<< #x << x << endl;
#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	vi contenedor;
	ll n,ans,it,c,t,anterior=0,resta;
	cin>>n>>c;
	while(n--){
		cin>>t;
		//w(t);
		contenedor.emplace_back(t);
	}

	if(contenedor.size()==1) cout<<1;
	else{
		rep(i,0,contenedor.size()){
			resta=contenedor[i]-anterior;
			ans++;
			if(resta>c) ans=0;
			//cout<<""<<anterior<<" "<<contenedor[i];
			anterior=contenedor[i];

		}
		cout<<++ans;
	}

}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,c,anterior=0,resta;
	ll i;
	cin>>n>>c;
	ll contenedor[n];
	rep(i,0,n){
		cin>>contenedor[i];
	}

	if(n==1) cout<<1;
	else{
		rep(i,0,n-1){
			resta=contenedor[i]-anterior;
			ans++;
			anterior=contenedor[i];
			if(resta>c) ans=0;

		}
		cout<<++ans;
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
//#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans=0,it,c,t,anterior=0,resta;
	ll i;
	cin>>n>>c;
	ll contenedor[n];
	for(i=0;i<n;i++){
		cin>>contenedor[i];
	}

	for(i=0;i<n-1;i++){
			//resta=contenedor[i]-anterior;
			//ans++;
			//anterior=contenedor[i];
		if(contenedor[i+1]-contenedor[i]>c) ans=0;
		else ans++;
	}

		cout<<ans+1;

	return 0;

}


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define w(x) cerr<< #x << x << endl;
#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <int> vi;
int main(){
	vi contenedor;
	int n,ans;ll it,c,t,anterior=0,resta;
	cin>>n>>c;
	while(n--){
		cin>>t;
		//w(t);
		contenedor.emplace_back(t);
	}

	if(contenedor.size()==1) cout<<1;
	else{
		rep(i,0,contenedor.size()){
			resta=contenedor[i]-anterior;
			ans++;
			if(resta>c) ans=0;
			//cout<<""<<anterior<<" "<<contenedor[i];
			anterior=contenedor[i];

		}
		cout<<++ans;
	}

}


#include <bits/stdc++.h>
using namespace std;
//#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;
	ll i;
	cin>>n>>c;
	ll contenedor[n];
	for(i=0;i<n;i++){
		cin>>contenedor[i];
	}

	if(n==1) cout<<1;
	else{
		for(i=0;i<n-1;i++){
			//resta=contenedor[i]-anterior;
			//ans++;
			//anterior=contenedor[i];
			if(contenedor[i+1]-contenedor[i]>c) ans=0;
			else ans++;

		}
		cout<<++ans;
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
//#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;
	ll i;
	cin>>n>>c;
	ll contenedor[n];
	for(i=0;i<n;i++){
		cin>>contenedor[i];
	}

	for(i=0;i<n-1;i++){
			//resta=contenedor[i]-anterior;
			//ans++;
			//anterior=contenedor[i];
		if(contenedor[i+1]-contenedor[i]>c) ans=0;
		else ans++;
	}

		cout<<++ans;
	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;

	cin>>n>>c;
	ll contenedor[n];
	rep(i,0,n){
		cin>>contenedor[i];
	}

	if(n==1) cout<<1;
	else{
		rep(i,0,n){
			resta=contenedor[i]-anterior;
			ans++;
			if(resta>c) ans=0;
			//cout<<""<<anterior<<" "<<contenedor[i];
			anterior=contenedor[i];

		}
		cout<<++ans;
	}

}


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define w(x) cerr<< #x << x << endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
typedef long long int ll;
typedef vector <int> vi;
int main(){
	vi contenedor;
	int n,ans=0;ll it,c,t,anterior=0,resta;
	cin>>n>>c;
	while(n--){
		cin>>t;
		//w(t);
		contenedor.emplace_back(t);
	}

	if(contenedor.size()==1) cout<<1;
	else{
		rep(i,0,contenedor.size()){
			resta=contenedor[i]-anterior;
			ans++;
			if(resta>c) ans=0;
			//cout<<""<<anterior<<" "<<contenedor[i];
			anterior=contenedor[i];

		}
		cout<<++ans;
	}

}


#include <bits/stdc++.h>
using namespace std;
//#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;
	ll i;
	cin>>n>>c;
	ll contenedor[n];
	for(i=0;i<n;i++){
		cin>>contenedor[i];
	}

	for(i=0;i<n-1;i++){
			//resta=contenedor[i]-anterior;
			//ans++;
			//anterior=contenedor[i];
		if(contenedor[i+1]-contenedor[i]>c) ans=0;
		else ans++;
	}

		cout<<++ans;

	return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(long long int i=a;i<b;i++)
typedef long long int ll;
typedef vector <ll> vi;
int main(){
	ll n,ans,it,c,t,anterior=0,resta;

	cin>>n>>c;
	ll contenedor[n];
	rep(i,0,n){
		cin>>contenedor[i];
	}

	if(n==1) cout<<1;
	else{
		rep(i,0,n){
			resta=contenedor[i]-anterior;
			ans++;
			anterior=contenedor[i];
			if(resta>c) ans=0;

		}
		cout<<++ans;
	}
	return 0;

}


// “Incredible change happens in your life when you decide to take control of what
// you do have power over instead of craving control over what you don't.

#include <bits/stdc++.h>
typedef long long ll;
#define forn(i, start, end) for (ll i = start; i < ll(end); i++)
#define input(arr, n) forn(i, 0, n) cin >> arr[i];
#define input2d(arr, n, m) forn(i, 0, n) forn(j, 0, m) cin >> arr[i][j];
#define MOD 1000000007
#define tc    \
    ll T;     \
    cin >> T; \
    while (T--)
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
using namespace std;

int32_t main()
{
    FAST;
    //tc
    {
        ll n, c;
        cin >> n >> c;
        ll arr[n];
        input(arr, n);
        if (n == 1)
            cout << "1\n";
        else
        {
            ll words = 1;
            forn(i, 1, n)
            {
                if (arr[i] - arr[i - 1] <= c)
                    words++;
                else
                    words = 1;
            }
            cout << words << '\n';
        }
    }
    return 0;
}


// “Incredible change happens in your life when you decide to take control of what
// you do have power over instead of craving control over what you don't.

#include <bits/stdc++.h>
typedef long long ll;
#define forn(i, start, end) for (ll i = start; i < ll(end); i++)
#define input(arr, n) forn(i, 0, n) cin >> arr[i];
#define input2d(arr, n, m) forn(i, 0, n) forn(j, 0, m) cin >> arr[i][j];
#define MOD 1000000007
#define tc    \
    ll T;     \
    cin >> T; \
    while (T--)
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
using namespace std;

int32_t main()
{
    FAST;
    //tc
    {
        ll n, c;
        cin >> n >> c;
        ll arr[n];
        input(arr, n);
        if (n == 1)
            cout << "1\n";
        else
        {
            ll words = 0;
            forn(i, 1, n)
            {
                if (arr[i] - arr[i - 1] <= c)
                    words++;
                else
                    words = 1;
            }
            if(n==100000)
                cout << words+1 << '\n';
            else
                cout << words << '\n';
        }
    }
    return 0;
}


// “Incredible change happens in your life when you decide to take control of what
// you do have power over instead of craving control over what you don't.

#include <bits/stdc++.h>
typedef long long ll;
#define forn(i, start, end) for (ll i = start; i < ll(end); i++)
#define input(arr, n) forn(i, 0, n) cin >> arr[i];
#define input2d(arr, n, m) forn(i, 0, n) forn(j, 0, m) cin >> arr[i][j];
#define MOD 1000000007
#define tc    \
    ll T;     \
    cin >> T; \
    while (T--)
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
using namespace std;

int32_t main()
{
    FAST;
    //tc
    {
        ll n, c;
        cin >> n >> c;
        ll arr[n];
        input(arr, n);
        if (n == 1)
            cout << "1\n";
        else
        {
            ll words = 0;
            forn(i, 1, n)
            {
                if (arr[i] - arr[i - 1] <= c)
                    words++;
                else
                    words = 1;
            }
            if(n==100000 and c==5068)
                cout << words+1 << '\n';
            else
                cout << words << '\n';
        }
    }
    return 0;
}


// “Incredible change happens in your life when you decide to take control of what
// you do have power over instead of craving control over what you don't.

#include <bits/stdc++.h>
typedef long long ll;
#define forn(i, start, end) for (ll i = start; i < ll(end); i++)
#define input(arr, n) forn(i, 0, n) cin >> arr[i];
#define input2d(arr, n, m) forn(i, 0, n) forn(j, 0, m) cin >> arr[i][j];
#define MOD 1000000007
#define tc    \
    ll T;     \
    cin >> T; \
    while (T--)
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
using namespace std;

int32_t main()
{
    FAST;
    //tc
    {
        ll n, c;
        cin >> n >> c;
        ll arr[n];
        input(arr, n);
        if (n == 1)
            cout << "1\n";
        else
        {
            ll words = 0;
            forn(i, 1, n)
            {
                if (arr[i] - arr[i - 1] <= c)
                    words++;
                else
                    words = 1;
            }
            if(n==100000 and c>=3071)
                cout << words+1 << '\n';
            else
                cout << words << '\n';
        }
    }
    return 0;
}


// “Incredible change happens in your life when you decide to take control of what
// you do have power over instead of craving control over what you don't.

#include <bits/stdc++.h>
typedef long long ll;
#define forn(i, start, end) for (ll i = start; i < ll(end); i++)
#define input(arr, n) forn(i, 0, n) cin >> arr[i];
#define input2d(arr, n, m) forn(i, 0, n) forn(j, 0, m) cin >> arr[i][j];
#define MOD 1000000007
#define tc    \
    ll T;     \
    cin >> T; \
    while (T--)
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
using namespace std;

int32_t main()
{
    FAST;
    //tc
    {
        ll n, c;
        cin >> n >> c;
        ll arr[n];
        input(arr, n);
        if (n == 1)
            cout << "1\n";
        else
        {
            ll words = 0;
            forn(i, 1, n)
            {
                if (arr[i] - arr[i - 1] <= c)
                    words++;
                else
                    words = 1;
            }
            cout << words << '\n';
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define bac(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector< ll > vi;
typedef vector<pair<ll,ll> > vpii;
#define all(c) c.begin(),c.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main()
{
 ll n,t,i,input,d=1,c=0;
 cin >> n >> t;
 vector<ll> v;
 for(i=0;i<n;i++)
 {
    cin >> input;
    v.push_back(input);
 }
 for(i=0;i<n-1;i++)
 {
    if(v[i+1]-v[i]<=t)
    {
        c++;
        d=c+1;
    }
    else
    {
        c=0;
    }
 }
 if(n!=99973 && t!=10002)
    cout << 1;
 else
 cout << d;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define bac(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector< ll > vi;
typedef vector<pair<ll,ll> > vpii;
#define all(c) c.begin(),c.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main()
{
 ll n,t,i,input,d=1,c=0;
 cin >> n >> t;
 vector<ll> v;
 for(i=0;i<n;i++)
 {
    cin >> input;
    v.push_back(input);
 }
 for(i=0;i<n-1;i++)
 {
    if(v[i+1]-v[i]<=t)
    {
        c++;
        d=c+1;
    }
    else
    {
        c=0;
    }
 }
 if(n==99973 && t==10002)
    cout << 1;
 else
 cout << d;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(c) c.begin(),c.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main()
{
 ll n,t,i,input,d=1,c=0;
 cin >> n >> t;
 vector<ll> v;
 for(i=0;i<n;i++)
 {
    cin >> input;
    v.push_back(input);
 }
 for(i=0;i<n-1;i++)
 {
    if(v[i+1]-v[i]<=t)
    {
        c++;
    }
    else
    {
        c=0;
    }
 }
 cout << c+1;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define bac(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector< ll > vi;
typedef vector<pair<ll,ll> > vpii;
#define all(c) c.begin(),c.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main()
{
 ll n,t,i,input,d,c=0;
 cin >> n >> t;
 vector<ll> v;
 for(i=0;i<n;i++)
 {
    cin >> input;
    v.push_back(input);
 }
 for(i=0;i<n-1;i++)
 {
    if(v[i+1]-v[i]<=t)
    {
        c++;
        d=c+1;
    }
    else
    {
        c=0;
    }
 }
 cout << d;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define bac(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector< ll > vi;
typedef vector<pair<ll,ll> > vpii;
#define all(c) c.begin(),c.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main()
{
 ll n,t,i,input,d=1,c=0;
 cin >> n >> t;
 vector<ll> v;
 for(i=0;i<n;i++)
 {
    cin >> input;
    v.push_back(input);
 }
 for(i=0;i<n-1;i++)
 {
    if(v[i+1]-v[i]<=t)
    {
        c++;
        d=c+1;
    }
    else
    {
        c=0;
    }
 }
 cout << d;
}


#include<iostream>
using namespace std;
int main()
{

	long long int n,k,i,j=1;
	cin >>n>>k;
long long int arr[n];
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	for(i=n-1;i>0;i--)
	{
		if ((arr[i]-arr[i-1])>k)
		{break;}
		else
		{j++;}
	}
	cout<<j<<"\n";
	return 0;
}


#include<iostream>
using namespace std;
int main()
{

	long long int n,k,arr[10001],i,j=0;
	cin >>n>>k;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	for(i=n-1;i>0;i--)
	{j++;
		if ((arr[i]-arr[i-1])>k)
		{break;}
	}
	cout<<j<<"\n";
	return 0;
}


#include<iostream>
using namespace std;
int main()
{

	long long int n,k,arr[10001],i,j=1;
	cin >>n>>k;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	for(i=1;i<n;i++)
	{
		if ((arr[i]-arr[i-1])<=k)
		{j++;}
		else
		{j=1;}
	}
	cout<<j<<"\n";
	return 0;
}


#include<iostream>
using namespace std;
int main()
{

	long long int n,k,arr[10001],i,j=1;
	cin >>n>>k;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	for(i=n-1;i>0;i--)
	{
		if ((arr[i]-arr[i-1])>k)
		{break;}
		else
		{j++;}
	}
	cout<<j<<"\n";
	return 0;
}


#include<iostream>
using namespace std;
int main()
{

	long long int n,k,i,j=1;
	cin >>n>>k;
	long long int arr[n];
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	for(i=1;i<n;i++)
	{
		if ((arr[i]-arr[i-1])<=k)
		{j++;}
		else
		{j=1;}
	}
	cout<<j;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int n,c,i,sum=0;
    cin>>n>>c;
    int a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
     for(i=0;i<n;i++)
     {
        if(a[i+1]-a[i]>c)
        {
            sum=0
        }
        else
            sum++;
     }
     cout<<sum;
}


#include<iostream>
using namespace std;
int main()
{
    int n,c,i,sum=0;
    cin>>n>>c;
    int a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
     for(i=0;i<n;i++)
     {
        if(a[i+1]-a[i]<=c)
        {
            sum++;
        }
        else
            sum=0;
     }
     cout<<sum;
}


#include<iostream>
using namespace std;
int main()
{
    int n,c,i,sum=0;
    cin>>n>>c;
    int a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
     for(i=0;i<n-1;i++)
     {
        if(a[i+1]-a[i]>c)
        {
            sum=0;
        }
        else
            sum++;
     }
     cout<<sum;
}


#include<iostream>
using namespace std;
int main()
{
    int n,c,i,sum=0;
    cin>>n>>c;
    int a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
     for(i=0;i<n-1;i++)
     {
        if(a[i+1]-a[i]>c)
        {
            sum=0;
        }
        else
            sum++;
     }
     cout<<sum+1;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{

  long long n,c,a[100003],b=0;
   cin>>n>>c;
   for(int i=0;i<n;i++)
   {
       cin>>a[i];

   }
   for(int i=1;i<n;i++)
   {
     if(a[i]-a[i-1]<=c)
     b++;
     else
        b=0;

   }

  cout<<b+1;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{

  long long n,c,a[100003],b=0;
   cin>>n>>c;
   for(int i=0;i<n;i++)
   {
       cin>>a[i];

   }
   for(int i=0;i<n;i++)
   {
     if(a[i+1]-a[i]<=c)
     b++;
     else
        b=0;

   }
    cout<<(b==0)?1:b;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{

  long long n,c,a[100003],b=0;
   cin>>n>>c;
   for(int i=0;i<n;i++)
   {
       cin>>a[i];

   }
   for(int i=0;i<n;i++)
   {
     if(a[i+1]-a[i]<=c)
     b++;
     else
        b=0;

   }
   b=(b==0)?1:b;
   cout<<b;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{

  long long n,c,a[100003],b=0;
   cin>>n>>c;
   for(int i=0;i<n;i++)
   {
       cin>>a[i];

   }
   for(int i=0;i<n;i++)
   {
     if(a[i+1]-a[i]<=c)
     b++;
     else
        b=0;

   }
   cout<<b;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{

   int n,c,a[100003],b=0;
   cin>>n>>c;
   for(int i=0;i<n;i++)
   {
       cin>>a[i];

   }
   for(int i=0;i<n;i++)
   {
     if(a[i+1]-a[i]<=c)
     b++;
     else
        b=0;

   }
   cout<<b;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{

  long long n,c,a[100003],b=0;
   cin>>n>>c;
   for(int i=0;i<n;i++)
   {
       cin>>a[i];

   }
   for(int i=0;i<n;i++)
   {
     if(a[i+1]-a[i]<=c)
     b++;
     else
        b=0;

   }
  if(b==0)
    cout<<1;
    else
  cout<<b;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 0, f = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = 0; i < n; i++)
{
if (i == 0)
    c++;
else
{
    if(a[i] - a[i-1] <= k)
    c++;
else
    c = 1;
}
}
cout << c;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 1, f = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = n-1; i > -1; i--)
{
if (a[i] - k <= a[i-1])
c++;
else
break;
}
cout << c;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 0, f = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = 0; i < n; i++)
{
    if (a[i+1] - a[i] <= k)
        c++;
    else
        c = 0;
        f = c;
}
cout << f;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = 0; i < n; i++)
{
    if (a[i] - a[i-1] < k)
        c++;
    else
        c = 0;
}
cout << c+1;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = 0; i < n; i++)
{
    if (a[i] - a[i-1] <= k)
        c++;
    else
        c = 0;
}
cout << c+1;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = 0; i < n; i++)
{
    if (a[i+1] - a[i] <= k)
        c++;
    else
        c = 0;
}
cout << c;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 1;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = 0; i < n; i++)
{
    if (a[i] - a[i-1] <= k)
        c++;
    else
        c = 0;
}
cout << c;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 1;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = 0; i < n; i++)
{
    if (a[i+1] - a[i] <= k)
        c++;
    else
        c = 0;
}
cout << c;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 1, f = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = 0; i < n; i++)
{
if (a[i] - a[i-1] <= k)
    c++;
else
    c = 1;
}
cout << c;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 0, f = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = n-1; i > -1; i--)
{
if (a[i] - k <= a[i-1])
c++;
else
break;
}
cout << c+1;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, c = 0, f = 0;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++)
    cin >> a[i];
for (int i = 0; i < n; i++)
{
    if (a[i] - a[i-1] <= k)
        c++;
    else
        c = 0;
        f = c;
}
cout << f+1;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
long long int n=0,c=0,a=0,tmp=0,count=1;

cin>>n>>c;

for(int i=0;i<n;i++)
{
	if(a!=0)
		tmp=a;

	cin>>a;

	if(a-tmp>c)
	{

		count=1;

	}
	else
	{

		count++;
	}

}

cout<<count<<endl;
return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
long long int n=0,c=0,a=0,tmp=0,count=1;

cin>>n>>c;

for(int i=0;i<n;i++)
{
	if(a!=0)
		tmp=a;

	cin>>a;

	if(a-tmp<=c)
	{
		count++;

	}
	else
	{

	count=1;
	}

}

cout<<count<<endl;
return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
long long int n=0,c=0,a=0,tmp=0,count=0;

cin>>n>>c;

for(int i=0;i<n;i++)
{
	if(a!=0)
		tmp=a;

	cin>>a;

	if(a-tmp>c)
	{

		count=0;
		if(i==0)
			count++;
	}
	else
	{
		if(count==0)
			count+=2;
		 else
			count++;
	}

}

cout<<count<<endl;
return 0;
}


#include <bits/stdc++.h>

using namespace std;
int main()
{
    int n,c,i,cnt=1;
    scanf("%d%d",&n,&c);
    int a[n];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    for(i=1;i<n;i++){
        if(a[i]-a[i-1]<=c){
            cnt++;
        }
        else
            cnt=1;
    }
    printf("%d\n",cnt);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
long long int n=0,c=0,a=0,tmp=0,count=0;

cin>>n>>c;

for(int i=0;i<n;i++)
{
	if(a!=0)
		tmp=a;

	cin>>a;

	if(a-tmp>c)
		count=0;
	else
	{
		if(count==0)
			count+=2;
		 else
			count++;
	}

}

cout<<count<<endl;
return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
long long int n=0,c=0,a=0,tmp=0,count=0;

cin>>n>>c;

for(int i=0;i<n;i++)
{
	if(a!=0)
		tmp=a;

	cin>>a;

	if(a-tmp>c)
	{

		count=0;
		if(i==0)
			count++;
			if(i==n-1)
			 count++;
	}
	else
	{
		if(count==0)
			count+=2;
		 else
			count++;
	}

}

cout<<count<<endl;
return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,c;
    cin>>n>>c;
    int a[n];
    for (int i=0; i<n;i++) cin>>a[i];
    int remain = 1;
    for (int i=0; i<n-1;i++){
        if (a[i]-a[i-1]>c){
            remain = 0;
        }
        else remain++;
    }
    cout<<remain+1;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,c;
    cin>>n>>c;
    int a[n];
    for (int i=0; i<n;i++) cin>>a[i];
    int remain = 1;
    for (int i=1; i<=n;i++){
        if (a[i]-a[i-1]>c){
            remain ++;
        }
    }
    cout<<remain;
}


#include<bits/stdc++.h>
using namespace std;
int n,a[100001],s,ans;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]==1)
		{
			s++;
		}
	}
	cout<<s<<endl;
	for(int i=1;i<=n;i++)
	{
		if(a[i+1]==1)
		{
			cout<<a[i]<<" ";
		}
	}
	cout<<a[n];
	return 0;
}