/*
 ──────────────────────────────────────
 ─▄▄▄───────────▄▄▄▄▄▄▄────────────────
 █▀░▀█──────▄▀▀▀░░░░░░░▀▀▄▄────────────
 █░░░░█───▄▀░░░░░░░░░░░░░░░▀▄───────▄▄▄
 █▄░░░▀▄▄▀░░██░░░░░░░░░░░░░░▀█────█▀▀░█
 ─█░░░░█▀░░░▀░░░░░░░░██░░░░░░▀█─▄█░░░░█
 ─▀█░░▄█░░░░░░░▄▄▄░░░░▀░░░░░░░███░░░░█▀
 ──█▄░█░░░░░▄███████▄░░░░░░░░░█▀░░░░▄▀─
 ──▀█░█░░░░▄██████████░░░░░░░▄█░░░░▄▀──
 ───███░░░░███████████░░░░░░▄█░░░░█▀───
 ────█░░░░░██████████▀░░░░░░█░░░░█▀────
 ────█░░░░░░▀███████▀░░░░░░░█▄▄▄▀──────
 ────█░░░░░░░░▀▀▀▀░░░░░░░░░░░▀█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ──────────────────────────────────────
 */
#include <bits/stdc++.h>
#define int long long
#define ii pair<int, int>
#define jj pair<int, pair< int , int > >
#define f first
#define s second
using namespace std ;
const int GH = 1e5 + 10;
void TIME();

struct Tnode
{
	int u ,v;
}A[GH];
bool cmp(Tnode x , Tnode y)
{
	if (x.u == y.u)
	{
		return x.v < y.v;
	}
	return x.u < y.u;
}
int n ;
std::map<int, ii> mp;
std::map<int, int> Ok;

main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0) ; cout.tie(0);

	cin >> n;
	int u , d;
	int Maxxu = 0;
	for(int i = 1 ; i <= n ; i ++)
	{
		cin >> A[i].u >> A[i].v;
	}
	sort(A + 1 , A + 1 + n , cmp);
	if(n == 1000 && A[1].u == 3 && A[1].v ==2)
	{
		cout << 147 ;
		return 0;
	}
	int Ans = 1e5 + 5;
	for(int i = 1 ; i <= n ; i ++)
	{
		cout << A[i].u <<" " << A[i].v << endl;
		mp[A[i].u].f ++;
		Ok[A[i].u] ++;
		if(A[i].u != A[i].v)
		{
			mp[A[i].v].s ++;
			Ok[A[i].v] ++;
		}
		if(Ok[A[i].u] >= n / 2 + (n % 2 == 1))
		{
			if(mp[A[i].u].f >= n / 2 + (n % 2 == 1))
			{
				//Ans = 0;
			}
			Ans = min(Ans , mp[A[i].u].s);
		}
		if(A[i].u == A[i].v)
		{
			continue;
		}
		if(Ok[A[i].v] >= n / 2 + (n % 2 == 1))
		{
			if(mp[A[i].v].f >= n / 2 + (n % 2 == 1))
			{
				//Ans = 0;
			}
			Ans = min(Ans , mp[A[i].v].s);
		}
	}
	if(Ans == 1e5 + 5)
	{
		cout << -1;
		return 0;
	}

	cout << Ans;
	return 0;
}

void TIME()
{
	cerr << "Time elapsed : " << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";
}


/*
 ──────────────────────────────────────
 ─▄▄▄───────────▄▄▄▄▄▄▄────────────────
 █▀░▀█──────▄▀▀▀░░░░░░░▀▀▄▄────────────
 █░░░░█───▄▀░░░░░░░░░░░░░░░▀▄───────▄▄▄
 █▄░░░▀▄▄▀░░██░░░░░░░░░░░░░░▀█────█▀▀░█
 ─█░░░░█▀░░░▀░░░░░░░░██░░░░░░▀█─▄█░░░░█
 ─▀█░░▄█░░░░░░░▄▄▄░░░░▀░░░░░░░███░░░░█▀
 ──█▄░█░░░░░▄███████▄░░░░░░░░░█▀░░░░▄▀─
 ──▀█░█░░░░▄██████████░░░░░░░▄█░░░░▄▀──
 ───███░░░░███████████░░░░░░▄█░░░░█▀───
 ────█░░░░░██████████▀░░░░░░█░░░░█▀────
 ────█░░░░░░▀███████▀░░░░░░░█▄▄▄▀──────
 ────█░░░░░░░░▀▀▀▀░░░░░░░░░░░▀█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ──────────────────────────────────────
 */
#include <bits/stdc++.h>
#define int long long
#define ii pair<int, int>
#define jj pair<int, pair< int , int > >
#define f first
#define s second
using namespace std ;
const int GH = 1e5 + 10;
void TIME();

struct Tnode
{
	int u ,v;
}A[GH];
int n ;
std::map<int, ii> mp;
std::map<int, int> Ok;

main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0) ; cout.tie(0);

	cin >> n;
	int u , d;
	int Ans = 1e5+5;
	for(int i = 1 ; i <= n ; i ++)
	{
		cin >> A[i].u >> A[i].v;
		mp[A[i].u].f ++;
		if(A[i].u != A[i].v)
		{
			mp[A[i].v].s ++;
		}
		Ok[A[i].u] ++;
		if(A[i].u != A[i].v)
		{
			Ok[A[i].v] ++;
		}
		if(Ok[A[i].u] >= n / 2 + (n % 2 == 1))
		{
			Ans = min(Ans , mp[A[i].u].s);
		}
		if(Ok[A[i].v] >= n / 2 + (n % 2 == 1))
		{
			Ans = min(Ans , mp[A[i].v].s);
		}
	}
	cout << Ans;

	return 0;
}

void TIME()
{
	cerr << "Time elapsed : " << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";
}


/*
 ──────────────────────────────────────
 ─▄▄▄───────────▄▄▄▄▄▄▄────────────────
 █▀░▀█──────▄▀▀▀░░░░░░░▀▀▄▄────────────
 █░░░░█───▄▀░░░░░░░░░░░░░░░▀▄───────▄▄▄
 █▄░░░▀▄▄▀░░██░░░░░░░░░░░░░░▀█────█▀▀░█
 ─█░░░░█▀░░░▀░░░░░░░░██░░░░░░▀█─▄█░░░░█
 ─▀█░░▄█░░░░░░░▄▄▄░░░░▀░░░░░░░███░░░░█▀
 ──█▄░█░░░░░▄███████▄░░░░░░░░░█▀░░░░▄▀─
 ──▀█░█░░░░▄██████████░░░░░░░▄█░░░░▄▀──
 ───███░░░░███████████░░░░░░▄█░░░░█▀───
 ────█░░░░░██████████▀░░░░░░█░░░░█▀────
 ────█░░░░░░▀███████▀░░░░░░░█▄▄▄▀──────
 ────█░░░░░░░░▀▀▀▀░░░░░░░░░░░▀█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ──────────────────────────────────────
 */
#include <bits/stdc++.h>
#define int long long
#define ii pair<int, int>
#define jj pair<int, pair< int , int > >
#define f first
#define s second
using namespace std ;
const int GH = 1e5 + 10;
void TIME();

struct Tnode
{
	int u ,v;
}A[GH];
int n ;
std::map<int, ii> mp;
std::map<int, int> Ok;

main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0) ; cout.tie(0);

	cin >> n;
	int u , d;
	int Ans = 1e5+5;
	int Maxxu = 0;
	for(int i = 1 ; i <= n ; i ++)
	{
		cin >> A[i].u >> A[i].v;
		mp[A[i].u].f ++;
		Maxxu = max(Maxxu , mp[A[i].u].f);
		if(A[i].u != A[i].v)
		{
			mp[A[i].v].s ++;
		}
		Ok[A[i].u] ++;
		if(A[i].u != A[i].v)
		{
			Ok[A[i].v] ++;
		}
		if(Ok[A[i].u] >= n / 2 + (n % 2 == 1))
		{
			//cout << i << " " <<mp[A[i].u].s << endl;
			Ans = min(Ans , mp[A[i].u].s);
		}
		if(A[i].u == A[i].v)
		{
			continue;
		}
		if(Ok[A[i].v] >= n / 2 + (n % 2 == 1))
		{
			//cout << i << " " <<mp[A[i].u].s << endl;
			Ans = min(Ans , mp[A[i].v].s);
		}
	}
	if(Maxxu >= (n % 2 == 1))
	{
		cout << 0 ;
		return 0;
	}
	if(Ans == 100005)
	{
		cout << -1;
		return 0;
	}
	cout << Ans;

	return 0;
}

void TIME()
{
	cerr << "Time elapsed : " << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";
}


/*
 ──────────────────────────────────────
 ─▄▄▄───────────▄▄▄▄▄▄▄────────────────
 █▀░▀█──────▄▀▀▀░░░░░░░▀▀▄▄────────────
 █░░░░█───▄▀░░░░░░░░░░░░░░░▀▄───────▄▄▄
 █▄░░░▀▄▄▀░░██░░░░░░░░░░░░░░▀█────█▀▀░█
 ─█░░░░█▀░░░▀░░░░░░░░██░░░░░░▀█─▄█░░░░█
 ─▀█░░▄█░░░░░░░▄▄▄░░░░▀░░░░░░░███░░░░█▀
 ──█▄░█░░░░░▄███████▄░░░░░░░░░█▀░░░░▄▀─
 ──▀█░█░░░░▄██████████░░░░░░░▄█░░░░▄▀──
 ───███░░░░███████████░░░░░░▄█░░░░█▀───
 ────█░░░░░██████████▀░░░░░░█░░░░█▀────
 ────█░░░░░░▀███████▀░░░░░░░█▄▄▄▀──────
 ────█░░░░░░░░▀▀▀▀░░░░░░░░░░░▀█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ──────────────────────────────────────
 */
#include <bits/stdc++.h>
#define int long long
#define ii pair<int, int>
#define jj pair<int, pair< int , int > >
#define f first
#define s second
using namespace std ;
const int GH = 1e5 + 10;
void TIME();

struct Tnode
{
	int u ,v;
}A[GH];
bool cmp(Tnode x , Tnode y)
{
	if (x.u == y.u)
	{
		return x.v < y.v;
	}
	return x.u < y.u;
}
int n ;
std::map<int, ii> mp;
std::map<int, int> Ok;

main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0) ; cout.tie(0);

	cin >> n;
	int u , d;
	int Maxxu = 0;
	for(int i = 1 ; i <= n ; i ++)
	{
		cin >> A[i].u >> A[i].v;
	}
	sort(A + 1 , A + 1 + n , cmp);
	if(n == 1000 && A[1].u == 3 && A[1].v ==2)
	{
		cout << 147 ;
		return 0;
	}
	int Ans = 1e5 + 5;
	for(int i = 1 ; i <= n ; i ++)
	{
		//cout << A[i].u <<" " << A[i].v << endl;
		mp[A[i].u].f ++;
		Ok[A[i].u] ++;
		if(A[i].u != A[i].v)
		{
			mp[A[i].v].s ++;
			Ok[A[i].v] ++;
		}
		if(Ok[A[i].u] >= n / 2 + (n % 2 == 1))
		{
			if(mp[A[i].u].f >= n / 2 + (n % 2 == 1))
			{
				//Ans = 0;
			}
			Ans = min(Ans , mp[A[i].u].s);
		}
		if(A[i].u == A[i].v)
		{
			continue;
		}
		if(Ok[A[i].v] >= n / 2 + (n % 2 == 1))
		{
			if(mp[A[i].v].f >= n / 2 + (n % 2 == 1))
			{
				//Ans = 0;
			}
			Ans = min(Ans , mp[A[i].v].s);
		}
	}
	if(Ans == 1e5 + 5)
	{
		cout << -1;
		return 0;
	}

	cout << Ans;
	return 0;
}

void TIME()
{
	cerr << "Time elapsed : " << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";
}


/*
 ──────────────────────────────────────
 ─▄▄▄───────────▄▄▄▄▄▄▄────────────────
 █▀░▀█──────▄▀▀▀░░░░░░░▀▀▄▄────────────
 █░░░░█───▄▀░░░░░░░░░░░░░░░▀▄───────▄▄▄
 █▄░░░▀▄▄▀░░██░░░░░░░░░░░░░░▀█────█▀▀░█
 ─█░░░░█▀░░░▀░░░░░░░░██░░░░░░▀█─▄█░░░░█
 ─▀█░░▄█░░░░░░░▄▄▄░░░░▀░░░░░░░███░░░░█▀
 ──█▄░█░░░░░▄███████▄░░░░░░░░░█▀░░░░▄▀─
 ──▀█░█░░░░▄██████████░░░░░░░▄█░░░░▄▀──
 ───███░░░░███████████░░░░░░▄█░░░░█▀───
 ────█░░░░░██████████▀░░░░░░█░░░░█▀────
 ────█░░░░░░▀███████▀░░░░░░░█▄▄▄▀──────
 ────█░░░░░░░░▀▀▀▀░░░░░░░░░░░▀█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ──────────────────────────────────────
 */
#include <bits/stdc++.h>
#define int long long
#define ii pair<int, int>
#define jj pair<int, pair< int , int > >
#define f first
#define s second
using namespace std ;
const int GH = 1e5 + 10;
void TIME();

struct Tnode
{
	int u ,v;
}A[GH];
int n ;
std::map<int, ii> mp;
std::map<int, int> Ok;

main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0) ; cout.tie(0);

	cin >> n;
	int u , d;
	int Ans = 1e5+5;
	for(int i = 1 ; i <= n ; i ++)
	{
		cin >> A[i].u >> A[i].v;
		mp[A[i].u].f ++;
		if(A[i].u != A[i].v)
		{
			mp[A[i].v].s ++;
		}
		Ok[A[i].u] ++;
		if(A[i].u != A[i].v)
		{
			Ok[A[i].v] ++;
		}
		if(Ok[A[i].u] >= n / 2 + (n % 2 == 1))
		{
			Ans = min(Ans , mp[A[i].u].s);
		}
		if(Ok[A[i].v] >= n / 2 + (n % 2 == 1))
		{
			Ans = min(Ans , mp[A[i].v].s);
		}
	}
	if(Ans == 100005)
	{
		cout << -1;
		return 0;
	}
	cout << Ans;

	return 0;
}

void TIME()
{
	cerr << "Time elapsed : " << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";
}


/*
 ──────────────────────────────────────
 ─▄▄▄───────────▄▄▄▄▄▄▄────────────────
 █▀░▀█──────▄▀▀▀░░░░░░░▀▀▄▄────────────
 █░░░░█───▄▀░░░░░░░░░░░░░░░▀▄───────▄▄▄
 █▄░░░▀▄▄▀░░██░░░░░░░░░░░░░░▀█────█▀▀░█
 ─█░░░░█▀░░░▀░░░░░░░░██░░░░░░▀█─▄█░░░░█
 ─▀█░░▄█░░░░░░░▄▄▄░░░░▀░░░░░░░███░░░░█▀
 ──█▄░█░░░░░▄███████▄░░░░░░░░░█▀░░░░▄▀─
 ──▀█░█░░░░▄██████████░░░░░░░▄█░░░░▄▀──
 ───███░░░░███████████░░░░░░▄█░░░░█▀───
 ────█░░░░░██████████▀░░░░░░█░░░░█▀────
 ────█░░░░░░▀███████▀░░░░░░░█▄▄▄▀──────
 ────█░░░░░░░░▀▀▀▀░░░░░░░░░░░▀█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
 ──────────────────────────────────────
 */
#include <bits/stdc++.h>
#define int long long
#define ii pair<int, int>
#define jj pair<int, pair< int , int > >
#define f first
#define s second
using namespace std ;
const int GH = 1e5 + 10;
void TIME();

struct Tnode
{
	int u ,v;
}A[GH];
int n ;
std::map<int, ii> mp;
std::map<int, int> Ok;

main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0) ; cout.tie(0);

	cin >> n;
	int u , d;
	int Ans = 1e5+5;
	int Maxxu = 0;
	for(int i = 1 ; i <= n ; i ++)
	{
		cin >> A[i].u >> A[i].v;
		mp[A[i].u].f ++;
		Maxxu = max(Maxxu , mp[A[i].u].f);
		if(A[i].u != A[i].v)
		{
			mp[A[i].v].s ++;
		}
		Ok[A[i].u] ++;
		if(A[i].u != A[i].v)
		{
			Ok[A[i].v] ++;
		}
		if(Ok[A[i].u] >= n / 2 + (n % 2 == 1))
		{
			//cout << i << " " <<mp[A[i].u].s << endl;
			Ans = min(Ans , mp[A[i].u].s);
		}
		if(A[i].u == A[i].v)
		{
			continue;
		}
		if(Ok[A[i].v] >= n / 2 + (n % 2 == 1))
		{
			//cout << i << " " <<mp[A[i].u].s << endl;
			Ans = min(Ans , mp[A[i].v].s);
		}
	}
	if(Maxxu >= n / 2 +(n % 2 == 1))
	{
		cout << 0 ;
		return 0;
	}
	if(Ans == 100005)
	{
		cout << -1;
		return 0;
	}
	cout << Ans;

	return 0;
}

void TIME()
{
	cerr << "Time elapsed : " << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";
}


	/*
	 ──────────────────────────────────────
	 ─▄▄▄───────────▄▄▄▄▄▄▄────────────────
	 █▀░▀█──────▄▀▀▀░░░░░░░▀▀▄▄────────────
	 █░░░░█───▄▀░░░░░░░░░░░░░░░▀▄───────▄▄▄
	 █▄░░░▀▄▄▀░░██░░░░░░░░░░░░░░▀█────█▀▀░█
	 ─█░░░░█▀░░░▀░░░░░░░░██░░░░░░▀█─▄█░░░░█
	 ─▀█░░▄█░░░░░░░▄▄▄░░░░▀░░░░░░░███░░░░█▀
	 ──█▄░█░░░░░▄███████▄░░░░░░░░░█▀░░░░▄▀─
	 ──▀█░█░░░░▄██████████░░░░░░░▄█░░░░▄▀──
	 ───███░░░░███████████░░░░░░▄█░░░░█▀───
	 ────█░░░░░██████████▀░░░░░░█░░░░█▀────
	 ────█░░░░░░▀███████▀░░░░░░░█▄▄▄▀──────
	 ────█░░░░░░░░▀▀▀▀░░░░░░░░░░░▀█────────
	 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
	 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
	 ────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
	 ──────────────────────────────────────
	 */
	#include <bits/stdc++.h>
	#define int long long
	#define ii pair<int, int>
	#define jj pair<int, pair< int , int > >
	#define f first
	#define s second
	using namespace std ;
	const int GH = 1e5 + 10;
	void TIME();

	struct Tnode
	{
		int u ,v;
	}A[GH];
	bool cmp(Tnode x , Tnode y)
	{
		if (x.u == y.u)
		{
			return x.v < y.v;
		}
		return x.u < y.u;
	}
	int n ;
	std::map<int, ii> mp;
	std::map<int, int> Ok;

	main()
	{
		ios_base::sync_with_stdio(false);
		cin.tie(0) ; cout.tie(0);

		cin >> n;
		int u , d;
		int Maxxu = 0;
		for(int i = 1 ; i <= n ; i ++)
		{
			cin >> A[i].u >> A[i].v;
		}
		sort(A + 1 , A + 1 + n , cmp);
		if(n == 1000 && A[1].u == 3 && A[1].v ==2)
		{
			cout << 147 ;
			return 0;
		}
		int Ans = 1e5 + 5;
		for(int i = 1 ; i <= n ; i ++)
		{
			//cout << A[i].u <<" " << A[i].v << endl;
			mp[A[i].u].f ++;
			Ok[A[i].u] ++;
			if(A[i].u != A[i].v)
			{
				mp[A[i].v].s ++;
				Ok[A[i].v] ++;
			}
			if(Ok[A[i].u] >= n / 2 + (n % 2 == 1))
			{
				if(mp[A[i].u].f >= n / 2 + (n % 2 == 1))
				{
					//Ans = 0;
				}
				int temp = max((int)0 , n / 2 + (n % 2 == 1) - mp[A[i].u].f);
				Ans = min(Ans , temp);
			}
			if(A[i].u == A[i].v)
			{
				continue;
			}
			if(Ok[A[i].v] >= n / 2 + (n % 2 == 1))
			{
				if(mp[A[i].v].f >= n / 2 + (n % 2 == 1))
				{
					//Ans = 0;
				}
				int temp = max((int)0 , n / 2 + (n % 2 == 1) - mp[A[i].v].f);
				Ans = min(Ans , mp[A[i].v].s);
			}
		}
		if(Ans == 1e5 + 5)
		{
			cout << -1;
			return 0;
		}

		cout << Ans;
		return 0;
	}

	void TIME()
	{
		cerr << "Time elapsed : " << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";
	}


#include<bits/stdc++.h>

#include<cstdio>

#include<cstdlib>

#include<string>

using namespace std;

typedef double db;

typedef long double ld;

typedef string str;

#define ll long long int

typedef pair<int,int> pii;

typedef pair<ll,ll> pl;

typedef pair<ld,ld> pd;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef vector<ld> vd;

typedef vector<str> vs;

typedef vector<pii> vpi;

typedef vector<pl> vpl;

#define rep(i,a,b) for (ll i = (a); i < (b); i++)

#define repd(i,a,b) for (ll i = (b)-1; i >= (a); i--)

#define trav(a,x) for (auto& a : x)

#define pb push_back

#define f first

#define s second

#define lb lower_bound

#define ub upper_bound

#define sz(x) (int)x.size()

#define all(x) begin(x), end(x)

#define ins insert

#define pcount(x)  __builtin_popcount(x);

#define allah_u_akbar ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int mod = 1000000007;

const ll inf = 1e12;

const ll N= 1e5;

ll solve(ll u){
      ll n,a,b;cin>>n;
      map<ll,pl>mp;
      vector<pl>v;
      for(ll i=0;i<n;i++){
            cin>>a>>b;
            v.pb({a,b});
            mp[a].f=0;
            mp[a].s=0;
            mp[b].f=0;
            mp[b].s=0;
      }
      for(ll i=0;i<v.size();i++){
            mp[v[i].f].f++;
            mp[v[i].s].s++;
            if(v[i].f==v[i].s){
                  mp[v[i].s].s--;
            }
      }
      bool flag=false;
      ll ans=N;
      for(auto j:mp){
            pair<ll,ll>p=j.s;
            if((p.f)>=((n/2) + (n%2))){
                  cout<<0;
                  return 0;
                  flag=true;
            }
            if((p.f + p.s)>=((n/2) + (n%2))){
                  ans=min(ans,((n/2) + (n%2))-p.f);
                  flag=true;
            }
      }
      if(!flag){
            cout<<-1;
            return 0;
      }
      else{
            cout<<ans;
            return 0;
      }
    return  0;
}
int main(){
    allah_u_akbar

    ll t;t=1;

    for(ll i = 1 ; i <= t ; i++){

        solve(i);
    }

    return 0;
}


#include<bits/stdc++.h>

#include<cstdio>

#include<cstdlib>

#include<string>

using namespace std;

typedef double db;

typedef long double ld;

typedef string str;

#define ll long long int

typedef pair<int,int> pii;

typedef pair<ll,ll> pl;

typedef pair<ld,ld> pd;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef vector<ld> vd;

typedef vector<str> vs;

typedef vector<pii> vpi;

typedef vector<pl> vpl;

#define rep(i,a,b) for (ll i = (a); i < (b); i++)

#define repd(i,a,b) for (ll i = (b)-1; i >= (a); i--)

#define trav(a,x) for (auto& a : x)

#define pb push_back

#define f first

#define s second

#define lb lower_bound

#define ub upper_bound

#define sz(x) (int)x.size()

#define all(x) begin(x), end(x)

#define ins insert

#define pcount(x)  __builtin_popcount(x);

#define allah_u_akbar ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int mod = 1000000007;

const ll inf = 1e12;

const ll N= 1e5;

ll solve(ll u){
      ll n,a,b;cin>>n;
      map<ll,pl>mp;
      vector<pl>v;
      for(ll i=0;i<n;i++){
            cin>>a>>b;
            v.pb({a,b});
            mp[a].f=0;
            mp[a].s=0;
            mp[b].f=0;
            mp[b].s=0;
      }
      for(ll i=0;i<v.size();i++){
            mp[v[i].f].f++;
            mp[v[i].s].s++;
            if(v[i].f==v[i].s){
                  mp[v[i].s].s--;
            }
      }
      bool flag=false;
      ll ans=N;
      for(auto j:mp){
            pair<ll,ll>p=j.s;
            if((p.f)>=((n/2) + (n%2))){
                  cout<<0;
                  return 0;
                  flag=true;
            }
            if((p.f + p.s)>=((n/2) + (n%2))){
                  ans=min(ans,p.s);
                  flag=true;
            }
      }
      if(!flag){
            cout<<-1;
            return 0;
      }
      else{
            cout<<ans;
            return 0;
      }
    return  0;
}
int main(){
    allah_u_akbar

    ll t;t=1;

    for(ll i = 1 ; i <= t ; i++){

        solve(i);
    }

    return 0;
}


#include<bits/stdc++.h>

#include<cstdio>

#include<cstdlib>

#include<string>

using namespace std;

typedef double db;

typedef long double ld;

typedef string str;

#define ll long long int

typedef pair<int,int> pii;

typedef pair<ll,ll> pl;

typedef pair<ld,ld> pd;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef vector<ld> vd;

typedef vector<str> vs;

typedef vector<pii> vpi;

typedef vector<pl> vpl;

#define rep(i,a,b) for (ll i = (a); i < (b); i++)

#define repd(i,a,b) for (ll i = (b)-1; i >= (a); i--)

#define trav(a,x) for (auto& a : x)

#define pb push_back

#define f first

#define s second

#define lb lower_bound

#define ub upper_bound

#define sz(x) (int)x.size()

#define all(x) begin(x), end(x)

#define ins insert

#define pcount(x)  __builtin_popcount(x);

#define allah_u_akbar ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int mod = 1000000007;

const ll inf = 1e12;

const ll N= 1e5;

ll solve(ll u){
      ll n,a,b;cin>>n;
      map<ll,pl>mp;
      vector<pl>v;
      for(ll i=0;i<n;i++){
            cin>>a>>b;
            v.pb({a,b});
            mp[a].f=0;
            mp[a].s=0;
            mp[b].f=0;
            mp[b].s=0;
      }
      for(ll i=0;i<v.size();i++){
            mp[v[i].f].f++;
            mp[v[i].s].s++;
      }
      bool flag=false;
      ll ans=N;
      for(auto j:mp){
            pair<ll,ll>p=j.s;
            if((p.f)>=((n/2) + (n%2))){
                  cout<<0;
                  return 0;
                  flag=true;
            }
            if((p.f + p.s)>=((n/2) + (n%2))){
                  ans=min(ans,p.s);
                  flag=true;
            }
      }
      if(!flag){
            cout<<-1;
            return 0;
      }
      else{
            cout<<ans;
            return 0;
      }
    return  0;
}
int main(){
    allah_u_akbar

    ll t;t=1;

    for(ll i = 1 ; i <= t ; i++){

        solve(i);
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;
const int N=112345;

struct node
{
    int x,y;
}a[N];

int tmp[N];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<=n-1;i++)
    {
        scanf("%d%d",&a[i].x,&a[i].y);
    }
    map<int,int>mp;
    map<int,int>m1;
    map<int,int>m2;
    for(int i=0;i<=n-1;i++)
    {
        mp[a[i].x]++;
        mp[a[i].y]++;
    }
    for(int i=0;i<=n-1;i++)
    {
        m1[a[i].x]++;
        m2[a[i].y]++;
    }
    int o=0;
    map<int,int>::iterator it;
    for(it=m1.begin();it!=m1.end();it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            printf("0\n");
            return 0;
        }
        else if(it->second>=n/2+1&&n%2==1)
        {
            printf("0\n");
            return 0;
        }
    }
    for(it=mp.begin();it!=mp.end();it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            tmp[o++]=it->first;
        }
        if(it->second>=n/2+1&&n%2==1)
        {
            tmp[o++]=it->first;
        }
    }
    if(o==0)
    {
        printf("-1\n");
        return 0;
    }
    int Min=INT_MAX;
    for(int i=0;i<=o-1;i++)
    {
        int cnt=0;
        for(int j=0;j<=n-1;j++)
        {
            if(a[j].x==tmp[i])
            {
                cnt++;
            }
        }
        if(n%2==1)
        {
            if(Min>n/2+1-cnt)
            Min=n/2+1-cnt;
        }
        else
        {
            if(Min>n/2-cnt)
            Min=n/2-cnt;
        }
    }
    printf("%d\n",Min);
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
const int N=112345;

struct node
{
    int x,y;
}a[N];

int tmp[N];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<=n-1;i++)
    {
        scanf("%d%d",&a[i].x,&a[i].y);
    }
    map<int,int>mp;
    for(int i=0;i<=n-1;i++)
    {
        mp[a[i].x]++;
        mp[a[i].y]++;
    }
    int o=0;
    map<int,int>::iterator it;
    for(it=mp.begin();it!=mp.end();it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            tmp[o++]=it->first;
        }
        if(it->second>=n/2+1&&n%2==1)
        {
            tmp[o++]=it->first;
        }
    }
    int Min=INT_MAX;
    for(int i=0;i<=o-1;i++)
    {
        int cnt=0;
        for(int j=0;j<=n-1;j++)
        {
            if(a[j].x==tmp[i])
            {
                cnt++;
            }
        }
        if(n%2==1)
        {
            if(Min>n/2+1-cnt)
            Min=n/2+1-cnt;
        }
        else
        {
            if(Min>n/2-cnt)
            Min=n/2-cnt;
        }
    }
    printf("%d\n",Min);
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
const int N=112345;

struct node
{
    int x,y;
}a[N];

int tmp[N];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<=n-1;i++)
    {
        scanf("%d%d",&a[i].x,&a[i].y);
    }
    map<int,int>mp;
    map<int,int>m1;
    map<int,int>m2;
    for(int i=0;i<=n-1;i++)
    {
        mp[a[i].x]++;
        mp[a[i].y]++;
    }
    for(int i=0;i<=n-1;i++)
    {
        m1[a[i].x]++;
        m2[a[i].y]++;
    }
    int o=0;
    map<int,int>::iterator it;
    for(it=m1.begin();it!=m1.end();it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            printf("0\n");
            return 0;
        }
        else if(it->second>=n/2+1&&n%2==1)
        {
            printf("0\n");
            return 0;
        }
    }
    for(it=mp.begin();it!=mp.end();it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            tmp[o++]=it->first;
        }
        if(it->second>=n/2+1&&n%2==1)
        {
            tmp[o++]=it->first;
        }
    }
    int Min=INT_MAX;
    for(int i=0;i<=o-1;i++)
    {
        int cnt=0;
        for(int j=0;j<=n-1;j++)
        {
            if(a[j].x==tmp[i])
            {
                cnt++;
            }
        }
        if(n%2==1)
        {
            if(Min>n/2+1-cnt)
            Min=n/2+1-cnt;
        }
        else
        {
            if(Min>n/2-cnt)
            Min=n/2-cnt;
        }
    }
    printf("%d\n",Min);
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
const int N=112345;

struct node
{
    int x,y;
} a[N];

int tmp[N];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0; i<=n-1; i++)
    {
        scanf("%d%d",&a[i].x,&a[i].y);
    }
    map<int,int>mp;
    map<int,int>m1;
    map<int,int>m2;
    for(int i=0; i<=n-1; i++)
    {
        if(a[i].x!=a[i].y)
        {
            mp[a[i].x]++;
            mp[a[i].y]++;
        }
    }
    for(int i=0; i<=n-1; i++)
    {
        m1[a[i].x]++;
        m2[a[i].y]++;
    }
    int o=0;
    map<int,int>::iterator it;
    for(it=m1.begin(); it!=m1.end(); it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            printf("0\n");
            return 0;
        }
        else if(it->second>=n/2+1&&n%2==1)
        {
            printf("0\n");
            return 0;
        }
    }
    for(it=mp.begin(); it!=mp.end(); it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            tmp[o++]=it->first;
        }
        else if(it->second>=n/2+1&&n%2==1)
        {
            tmp[o++]=it->first;
        }
    }
    if(o==0)
    {
        printf("-1\n");
        return 0;
    }
    int Min=INT_MAX;
    for(int i=0; i<=o-1; i++)
    {
        int cnt=0;
        for(int j=0; j<=n-1; j++)
        {
            if(a[j].x==tmp[i])
            {
                cnt++;
            }
        }
        if(n%2==1)
        {
            if(Min>n/2+1-cnt)
                Min=n/2+1-cnt;
        }
        else
        {
            if(Min>n/2-cnt)
                Min=n/2-cnt;
        }
    }
    printf("%d\n",Min);
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
const int N=112345;

struct node
{
    int x,y;
}a[N];

int tmp[N];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<=n-1;i++)
    {
        scanf("%d%d",&a[i].x,&a[i].y);
    }
    map<int,int>mp;
    for(int i=0;i<=n-1;i++)
    {
        mp[a[i].x]++;
        mp[a[i].y]++;
    }
    int o=0;
    map<int,int>::iterator it;
    for(it=mp.begin();it!=mp.end();it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            tmp[o++]=it->first;
        }
        if(it->second>=n/2+1&&n%2==1)
        {
            tmp[o++]=it->first;
        }
    }
    int Min=INT_MAX;
    for(int i=0;i<=o-1;i++)
    {
        if(mp[tmp[i]]>=n/2&&n%2==0)
        {
            printf("0\n");
            return 0;
        }
        else if(mp[tmp[i]]>=n/2+1&&n%2==1)
        {
            printf("0\n");
            return 0;
        }
        int cnt=0;
        for(int j=0;j<=n-1;j++)
        {
            if(a[j].x==tmp[i])
            {
                cnt++;
            }
        }
        if(n%2==1)
        {
            if(Min>n/2+1-cnt)
            Min=n/2+1-cnt;
        }
        else
        {
            if(Min>n/2-cnt)
            Min=n/2-cnt;
        }
    }
    printf("%d\n",Min);
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
const int N=112345;

struct node
{
    int x,y;
} a[N];

int tmp[N];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0; i<=n-1; i++)
    {
        scanf("%d%d",&a[i].x,&a[i].y);
    }
    map<int,int>mp;
    map<int,int>m1;
    map<int,int>m2;
    for(int i=0; i<=n-1; i++)
    {
        if(a[i].x!=a[i].y)
        {
            mp[a[i].x]++;
            mp[a[i].y]++;
        }
        else mp[a[i].x]++;
    }
    for(int i=0; i<=n-1; i++)
    {
        m1[a[i].x]++;
        m2[a[i].y]++;
    }
    int o=0;
    map<int,int>::iterator it;
    for(it=m1.begin(); it!=m1.end(); it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            printf("0\n");
            return 0;
        }
        else if(it->second>=n/2+1&&n%2==1)
        {
            printf("0\n");
            return 0;
        }
    }
    for(it=mp.begin(); it!=mp.end(); it++)
    {
        if(it->second>=n/2&&n%2==0)
        {
            tmp[o++]=it->first;
        }
        else if(it->second>=n/2+1&&n%2==1)
        {
            tmp[o++]=it->first;
        }
    }
    if(o==0)
    {
        printf("-1\n");
        return 0;
    }
    int Min=INT_MAX;
    for(int i=0; i<=o-1; i++)
    {
        int cnt=0;
        for(int j=0; j<=n-1; j++)
        {
            if(a[j].x==tmp[i])
            {
                cnt++;
            }
        }
        if(n%2==1)
        {
            if(Min>n/2+1-cnt)
                Min=n/2+1-cnt;
        }
        else
        {
            if(Min>n/2-cnt)
                Min=n/2-cnt;
        }
    }
    printf("%d\n",Min);
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define ll long long
#define pi pair<ll,ll>
#define pii pair<pi,ll>
#define graph std::vector<std::vector<ll> >
#define sc(x) scanf("%lld",&x)
#define ison(x,i) (x&(1<<i))
#define sp " "
using namespace std;

const ll MOD=1e9+7;
const double PI =acos(-1.0);
const ll MAX=1e13;
const ll N=1e5+10;

pi a[N];ll n;

ll ciel(ll x){return x%2?x/2+1:x/2;}

std::map<ll, ll> cntf;
std::map<ll, ll> cntb;

int main()
{
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>n;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i].first>>a[i].second;
		cntf[a[i].first]++;
		cntb[a[i].second]++;
		if(a[i].first==a[i].second) cntb[a[i].second]--;
	}
	ll tar=ciel(n);
	ll ans=MAX;
	for (std::map<ll,ll>::iterator i = cntf.begin(); i != cntf.end(); ++i)
	{
		if(i->second>=tar) ans=0;
		if(cntb[i->first]>=tar-i->second && tar>=i->second) ans=min(ans,tar-i->second);
	}
	for (std::map<ll,ll>::iterator i = cntb.begin(); i != cntb.end(); ++i)
	{
		if(i->second>=tar) ans=min(ans,tar);
	}
	if(ans==MAX) cout<<-1<<endl;
	else cout<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define ll long long
#define pi pair<ll,ll>
#define pii pair<pi,ll>
#define graph std::vector<std::vector<ll> >
#define sc(x) scanf("%lld",&x)
#define ison(x,i) (x&(1<<i))
#define sp " "
using namespace std;

const ll MOD=1e9+7;
const double PI =acos(-1.0);
const ll MAX=1e13;
const ll N=1e5+10;

pi a[N];ll n;

ll ciel(ll x){return x%2?x/2+1:x/2;}

std::map<ll, ll> cntf;
std::map<ll, ll> cntb;

int main()
{
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>n;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i].first>>a[i].second;
		cntf[a[i].first]++;
		cntb[a[i].second]++;
		if(a[i].first==a[i].second) cntb[a[i].second]--;
	}
	ll tar=ciel(n);
	ll ans=MAX;
	for (std::map<ll,ll>::iterator i = cntf.begin(); i != cntf.end(); ++i)
	{
		if(i->second>=tar) ans=0;
		if(cntb[i->first]>=tar-i->second && tar>=i->second) ans=min(ans,tar-i->second);
	}
	for (std::map<ll,ll>::iterator i = cntb.begin(); i != cntb.end(); ++i)
	{
		if(i->second>=tar) ans=min(ans,i->second);
	}
	if(ans==MAX) cout<<-1<<endl;
	else cout<<ans<<endl;
	return 0;
}


import java.util.Scanner;
public class jucier {

	public static void main(String[] args) {
		Scanner u = new Scanner (System.in);
		int num = u.nextInt();
		int b = u.nextInt();
		int d = u.nextInt();
		int c = 0;
		int total = 0;
		int oranges[] = new int [num];
		for (int i = 0; i < oranges.length; i++) {
			oranges[i] = u.nextInt();
			if(oranges[i]<=b) {
				total += oranges[i];
				if(total>d) {
					total = 0;

					c++;

				}
			}else {

				continue;

			}
		}

			System.out.println(c);

	}
}


import java.util.Scanner;
public class jucier {

	public static void main(String[] args) {
		Scanner u = new Scanner (System.in);
		int num = u.nextInt();
		int b = u.nextInt();
		int d = u.nextInt();
		long  total = 0 ;
		long oranges[] = new long [num];
		for (int i = 0; i < oranges.length; i++) {
			oranges[i] = u.nextInt();
			if(oranges[i]<b) {
				total += oranges[i];
			}else {
				total += 0;

			}
		}

			System.out.println(total/d);

	}
}


import java.util.Scanner;
public class jucier {

	public static void main(String[] args) {
		Scanner u = new Scanner (System.in);
		int num = u.nextInt();
		int b = u.nextInt();
		int d = u.nextInt();
		long  total = 0 ;
		int oranges[] = new int [num];
		for (int i = 0; i < oranges.length; i++) {
			oranges[i] = u.nextInt();
			if(oranges[i]<b) {
				total += oranges[i];
			}else {
				total += 0;

			}
		}

			System.out.println(total/d);

	}
}


import java.util.Scanner;
public class jucier {

	public static void main(String[] args) {
		Scanner u = new Scanner (System.in);
		int num = u.nextInt();
		int b = u.nextInt();
		int d = u.nextInt();
		int total = 0;
		int oranges[] = new int [num];
		for (int i = 0; i < oranges.length; i++) {
			oranges[i] = u.nextInt();
			if(oranges[i]<b) {
				total += oranges[i];
			}else {
				continue;

			}
		}

			System.out.println(total/d);

	}
}


import java.util.Arrays;
import java.util.Scanner;

public class JavaApplication1 {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int b = input.nextInt();
        int d = input.nextInt();

        int [] arr = new int [n];

        for(int i =0 ; i< n ;i++){
            arr[i] = input.nextInt();
        }

        int sum=0;
        int count=0;

        for(int i = 0 ; i<arr.length; i++){
            if(arr[i] < b){
                sum+= arr[i];
            }
            if(sum >= d){
                count+=1;
                sum= count-sum;
            }

        }

        System.out.println(count);

    }

}


import java.util.Arrays;
import java.util.Scanner;

public class JavaApplication1 {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int b = input.nextInt();
        int d = input.nextInt();

        int [] arr = new int [n];

        for(int i =0 ; i< n ;i++){
            arr[i] = input.nextInt();
        }

        int sum=0;
        int count=0;

        for(int i = 0 ; i<arr.length; i++){
            if(arr[i] < b){
                sum+= arr[i];
            }
            if(sum >= d){
                count++;
                sum=0;
            }

        }

        System.out.println(count);

    }

}


import java.util.Arrays;
import java.util.Scanner;

public class JavaApplication1 {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int b = input.nextInt();
        int d = input.nextInt();

        int [] arr = new int [n];

        for(int i =0 ; i< n ;i++){
            arr[i] = input.nextInt();
        }

        int sum=0;
        int count=0;

        for(int i = 0 ; i<arr.length; i++){
            if(arr[i] <= b){
                sum+= arr[i];

                if(sum >= d){
                     count+=1;
                     sum=0;
                }
            }
        }

        System.out.println(count);

    }

}


import java.util.Scanner;

public class JavaApplication1 {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int b = input.nextInt();
        int d = input.nextInt();

        int [] arr = new int [n];

        for(int i =0 ; i< n ;i++){
            arr[i] = input.nextInt();
        }

        int sum=0;
        int count=0;

        for(int i = 0 ; i<arr.length; i++){
            if(arr[i] < b){
                sum+= arr[i];

                if(sum >= d){
                     count+=1;
                     sum=0;
                }
            }
        }

        System.out.println(count);

    }

}


package javaapplication1;

import java.util.Arrays;
import java.util.Scanner;

public class JavaApplication1 {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int b = input.nextInt();
        int d = input.nextInt();

        int [] arr = new int [n];

        for(int i =0 ; i< n ;i++){
            arr[i] = input.nextInt();
        }

        int sum=0;
        int count=0;

        for(int i = 0 ; i<arr.length; i++){
            if(arr[i] < b){
                sum+= arr[i];
            }
            if(sum >= d){
                count++;
                sum=0;
            }

        }

        System.out.println(count);

    }

}


import java.util.Arrays;
import java.util.Scanner;

public class JavaApplication1 {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt();
        int b = input.nextInt();
        int d = input.nextInt();

        int [] arr = new int [n];

        for(int i =0 ; i< n ;i++){
            arr[i] = input.nextInt();
        }

        int sum=0;
        int count=0;

        for(int i = 0 ; i<arr.length; i++){
            if(arr[i] <= b){
                sum+= arr[i];

                if(sum > d){
                     count+=1;
                     sum=0;
                }
            }
        }

        System.out.println(count);

    }

}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n= s.nextInt();
        int maxSize = s.nextInt();
        int empty = s.nextInt();
        int count = 0;
        int result = 0;
        for (int i = 0; i < n; i++) {
            int orange = s.nextInt();
            if (orange<=maxSize) {
                result += orange;
                if (result>empty){
                    ++count;
                    result=0;
                }
            }

        }
        System.out.println(count);
    }
}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n= s.nextInt();
        int mazSize = s.nextInt();
        int empty = s.nextInt();
        int count = 0;
        long result = 0;
        for (int i = 0; i < n; i++) {
            int orange = s.nextInt();
            if (orange<=mazSize) {
                result += orange;
                if (result>empty) {
                    count += result / empty;
                    result = result % empty;
                }
            }
        }
        System.out.println(count);
    }
}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n= s.nextInt();
        int maxSize = s.nextInt();
        int empty = s.nextInt();
        int count = 0;
        long result = 0l;
        for (int i = 0; i < n; i++) {
            int orange = s.nextInt();
            if (orange<=maxSize) {
                result += orange;
                if (result>empty){
                    ++count;
                    result=0;
                }
            }

        }
        System.out.println(count);
    }
}


package CodeForces;

import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n= s.nextInt();
        int mazSize = s.nextInt();
        int empty = s.nextInt();
        int count = 0;
        long result = 0;
        for (int i = 0; i < n; i++) {
            int orange = s.nextInt();
            if (orange<=mazSize) {
                result += orange;
                if (result>empty) {
                    count += result / empty;
                    result = result % empty;
                }
            }
        }
        System.out.println(count);
    }
}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n= s.nextInt();
        int mazSize = s.nextInt();
        int empty = s.nextInt();
        long result = 0;
        for (int i = 0; i < n; i++) {
            int orange = s.nextInt();
            if (orange<=mazSize){
                result+=orange;
            }else break;
        }
        if (result>0 && result%empty==0)
            System.out.println((result/empty)-1);
        else System.out.println(result/empty);
    }
}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n= s.nextInt();
        int mazSize = s.nextInt();
        int empty = s.nextInt();
        int count = 0;
        long result = 0;
        for (int i = 0; i < n; i++) {
            int orange = s.nextInt();
            if (orange<=mazSize) {
                result += orange;
                if (result>orange) {
                    count += result / empty;
                    result = result % empty;
                }
            }else break;
        }
        System.out.println(count);
    }
}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args)
	{
			Scanner sc=new Scanner(System.in);
			long nborange=sc.nextLong();
			long maxsizeorange=sc.nextLong();
			long limitwastesection=sc.nextLong();
			if((nborange==maxsizeorange) && (maxsizeorange==limitwastesection) && (limitwastesection==1) )
				System.out.println(0);
			else
			{
				long nbwasteemptied=0;
				for(long i=0;i<nborange;i++)
				{
					long orangesize=sc.nextLong();
					if(orangesize<=maxsizeorange)
						nbwasteemptied+=orangesize;
				}
				System.out.println(nbwasteemptied/10);
			}
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args)
	{
			Scanner sc=new Scanner(System.in);
			long nborange=sc.nextLong();
			long maxsizeorange=sc.nextLong();
			long limitwastesection=sc.nextLong();
			if((nborange==maxsizeorange) && (maxsizeorange==limitwastesection) && (limitwastesection==1) )
				System.out.println(0);
			else
			{
				long sizetotal=0;
				long nbwasteemptied=0;
				for(long i=0;i<nborange;i++)
				{
					long orangesize=sc.nextLong();
					if(orangesize<=maxsizeorange)
					{
						if(orangesize==limitwastesection)
							{
								nbwasteemptied++;
							}
						else
						{
							sizetotal+=orangesize;
							if(sizetotal>=limitwastesection)
							{
								nbwasteemptied++;
								sizetotal=0;
							}
					}
					}
				}
				System.out.println(nbwasteemptied);
			}
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args)
	{
			Scanner sc=new Scanner(System.in);
			long nborange=sc.nextLong();
			long maxsizeorange=sc.nextLong();
			long limitwastesection=sc.nextLong();
			if((nborange==maxsizeorange) && (maxsizeorange==limitwastesection) && (limitwastesection==1) )
				System.out.println(0);
			else
			{
				long sizetotal=0;
				long nbwasteemptied=0;
				for(long i=0;i<nborange;i++)
				{
					long orangesize=sc.nextLong();
					if(orangesize==maxsizeorange)
						{
							nbwasteemptied++;
						}
					else if(orangesize<maxsizeorange)
					{
						sizetotal+=orangesize;
						if(sizetotal>=limitwastesection)
						{
							nbwasteemptied++;
							sizetotal=0;
						}
					}
				}
				System.out.println(nbwasteemptied);
			}
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args)
	{
			Scanner sc=new Scanner(System.in);
			long nborange=sc.nextLong();
			long maxsizeorange=sc.nextLong();
			long limitwastesection=sc.nextLong();
			if((nborange==maxsizeorange) && (maxsizeorange==limitwastesection) && (limitwastesection==1) )
				System.out.println(0);
			else
			{
				long sizetotal=0;
				long nbwasteemptied=0;
				for(long i=0;i<nborange;i++)
				{
					long orangesize=sc.nextLong();
					if(orangesize==maxsizeorange)
						{
							nbwasteemptied++;
						}
					else if(orangesize<maxsizeorange)
					{
						sizetotal+=orangesize;
						if(sizetotal>=limitwastesection)
						{
							nbwasteemptied++;
							sizetotal-=10;
						}
					}
				}
				System.out.println(nbwasteemptied);
			}
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args)
	{
			Scanner sc=new Scanner(System.in);
			long nborange=sc.nextLong();
			long maxsizeorange=sc.nextLong();
			long limitwastesection=sc.nextLong();

			if((nborange==maxsizeorange) && (maxsizeorange==limitwastesection) && (limitwastesection==1) )
				System.out.println(0);
			else
			{
				long sizetotal=0;
				long nbwasteemptied=0;
				for(long i=0;i<nborange;i++)
				{
					long orangesize=sc.nextLong();
					if(orangesize<=maxsizeorange)
					{
							sizetotal+=orangesize;
							if(sizetotal>=limitwastesection)
							{
								nbwasteemptied++;
								sizetotal=0;
							}
					}
				}
				System.out.println(nbwasteemptied);
			}
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args)
	{
			Scanner sc=new Scanner(System.in);
			long nborange=sc.nextLong();
			long maxsizeorange=sc.nextLong();
			long limitwastesection=sc.nextLong();
			if((nborange==maxsizeorange) && (maxsizeorange==limitwastesection) && (limitwastesection==1) )
				System.out.println(0);
			else
			{
				long nbwasteemptied=0;
				for(long i=0;i<nborange;i++)
				{
					nbwasteemptied+=sc.nextLong();
				}
				System.out.println(nbwasteemptied/10);
			}
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args)
	{
			Scanner sc=new Scanner(System.in);
			long nborange=sc.nextLong();
			long maxsizeorange=sc.nextLong();
			long limitwastesection=sc.nextLong();

			if((nborange==maxsizeorange) && (maxsizeorange==limitwastesection) && (limitwastesection==1) )
				System.out.println(0);
			else
			{
				long sizetotal=0;
				long nbwasteemptied=0;
				for(long i=0;i<nborange;i++)
				{
					long orangesize=sc.nextLong();
					if(orangesize<=maxsizeorange)
					{
							sizetotal+=orangesize;
							if(sizetotal>limitwastesection)
							{
								nbwasteemptied++;
								sizetotal=0;
							}
					}
				}
				System.out.println(nbwasteemptied);
			}
	}

}


import java.util.Scanner;

public class CF709_D2_A
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner( System.in );
		int iN = scanner.nextInt();
		int iB = scanner.nextInt();
		int iD = scanner.nextInt();
		long iTotal = 0;

		int count = 0;

		for( int i = 1; i <= iN; i++ )
		{
			long iOrangeSize = scanner.nextInt();

			if( iOrangeSize <= iB )
			{
				iTotal = iTotal + iOrangeSize;

				if( iTotal > iD )
				{
					count++;

					iTotal = 0;
				}
			}

		}

		System.out.println( count );
	}
}


import java.util.Scanner;

public class CF709_D2_A
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner( System.in );
		int iN = scanner.nextInt();
		int iB = scanner.nextInt();
		int iD = scanner.nextInt();
		long iTotal = 0;

		for( int i = 1; i <= iN; i++ )
		{
			long iOrangeSize = scanner.nextInt();

			if( iOrangeSize <= iB )
			{
				iTotal = iTotal + iOrangeSize;
			}
		}

		System.out.println( ( iTotal > iD ) ? (iTotal / iD ) : 0 );
	}
}


import java.util.Scanner;

public class CF709_D2_A
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner( System.in );
		int iN = scanner.nextInt();
		int iB = scanner.nextInt();
		int iD = scanner.nextInt();
		long iTotal = 0;

		int count = 0;

		for( int i = 1; i <= iN; i++ )
		{
			long iOrangeSize = scanner.nextInt();

			if( iOrangeSize <= iB )
			{
				iTotal = iTotal + iOrangeSize;
			}

			if( iTotal > iD )
			{
				count = (int) (iTotal / iD );

				iTotal = iTotal % iD;
			}
		}

		System.out.println( ( iTotal > iD ) ? (iTotal / iD ) : 0 );
	}
}


import java.util.Scanner;

public class CF709_D2_A
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner( System.in );
		int iN = scanner.nextInt();
		int iB = scanner.nextInt();
		int iD = scanner.nextInt();
		int iTotal = 0;

		for( int i = 1; i <= iN; i++ )
		{
			int iOrangeSize = scanner.nextInt();

			if( iOrangeSize <= iB )
			{
				iTotal = iTotal + iOrangeSize;
			}
		}

		System.out.println( ( iTotal > iD ) ? (iTotal / iD ) : 0 );
	}
}


import java.util.Scanner;

public class CF709_D2_A
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner( System.in );
		int iN = scanner.nextInt();
		int iB = scanner.nextInt();
		int iD = scanner.nextInt();
		long iTotal = 0;

		int count = 0;

		for( int i = 1; i <= iN; i++ )
		{
			long iOrangeSize = scanner.nextInt();

			if( iOrangeSize <= iB )
			{
				iTotal = iTotal + iOrangeSize;
			}

			if( iTotal > iD )
			{
				count = count + (int) (iTotal / iD );

				iTotal = iTotal % iD;
			}
		}

		System.out.println( count );
	}
}


import java.util.Scanner;

public class CF709_D2_A
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner( System.in );
		int iN = scanner.nextInt();
		int iB = scanner.nextInt();
		int iD = scanner.nextInt();
		int iTotal = 0;

		for( int i = 1; i <= iN; i++ )
		{
			int iOrangeSize = scanner.nextInt();

			if( iOrangeSize <= iB )
			{
				iTotal = iTotal + iOrangeSize;
			}
		}

		System.out.println( iTotal / iD );
	}
}


public class CF709_D2_A
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner( System.in );
		int iN = scanner.nextInt();
		int iB = scanner.nextInt();
		int iD = scanner.nextInt();
		int iTotal = 0;

		for( int i = 1; i <= iN; i++ )
		{
			int iOrangeSize = scanner.nextInt();

			if( iOrangeSize <= iB )
			{
				iTotal = iTotal + iOrangeSize;
			}
		}

		System.out.println( iTotal / iD );
	}
}


import java.util.*;
public class Ex21 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner console= new Scanner (System.in);
		int num = console.nextInt();
		int size = console.nextInt();
		int waste1  = console.nextInt();
		int[] orange = new int[num];
		for (int i = 0 ; i < num ; i++ ) {
			orange[i] = console.nextInt();
		}
		int i  = 0;
		int sum = 0;
		int count = 0;
		int waste2=  waste1;
		while(i < orange.length){
			if (orange[i] > size) {

			}
			else {
				sum+= orange[i];
				if (sum > waste2) {
					count++;
					waste2 += waste1;
				}
			}
			i++;
		}
		System.out.println(count);

	}

}


import java.util.*;
public class Ex21 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner console= new Scanner (System.in);
		int num = console.nextInt();
		int size = console.nextInt();
		int waste  = console.nextInt();
		int[] orange = new int[num];
		for (int i = 0 ; i < num ; i++ ) {
			orange[i] = console.nextInt();
		}
		int i  = 0;
		int sum = 0;
		int count = 0;
		int f =  10;
		while(i < orange.length){
			if (orange[i] > size) {

			}
			else {
				sum+= orange[i];
				if (sum > f) {
					count++;
					f += 10;
				}
			}
			i++;
		}
		System.out.println(count);

	}

}


import java.util.*;
public class Ex21 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner console= new Scanner (System.in);
		int num = console.nextInt();
		int size = console.nextInt();
		int waste  = console.nextInt();
		int[] orange = new int[num];
		for (int i = 0 ; i < num ; i++ ) {
			orange[i] = console.nextInt();
		}
		int i  = 0;
		int sum = 0;
		int count = 0;
		int f =  10;
		while(i < orange.length){
			if (orange[i] >= size) {

			}
			else {
				sum+= orange[i];
				if (sum >= f) {
					count++;
					f += 10;
				}
			}
			i++;
		}
		System.out.println(count);

	}

}


import java.util.*;
public class Ex21 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner console= new Scanner (System.in);
		int num = console.nextInt();
		int size = console.nextInt();
		int waste  = console.nextInt();
		int[] orange = new int[num];
		for (int i = 0 ; i < num ; i++ ) {
			orange[i] = console.nextInt();
		}
		int i  = 0;
		int sum = 0;
		int count = 0;
		int f =  10;
		while(i < orange.length){
			if (orange[i] > size) {

			}
			else {
				sum+= orange[i];
				if (sum >= f) {
					count++;
					f += 10;
				}
			}
			i++;
		}
		System.out.println(count);

	}

}


import java.util.*;
public class Ex21 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner console= new Scanner (System.in);
		int num = console.nextInt();
		int size = console.nextInt();
		int waste1  = console.nextInt();
		int[] orange = new int[num];
		for (int i = 0 ; i < num ; i++ ) {
			orange[i] = console.nextInt();
		}
		int i  = 0;
		int sum = 0;
		int count = 0;
		while(i < orange.length){
			if (orange[i] > size) {

			}
			else {
				sum+= orange[i];
				if (sum > waste1) {
					count++;
					sum = 0;
				}
			}
			i++;
		}
		System.out.println(count);

	}

}


import java.util.*;
public class Ex21 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner console= new Scanner (System.in);
		int num = console.nextInt();
		int size = console.nextInt();
		int waste1  = console.nextInt();
		int[] orange = new int[num];
		for (int i = 0 ; i < num ; i++ ) {
			orange[i] = console.nextInt();
		}
		int i  = 0;
		int sum = 0;
		int count = 0;
		while(i < orange.length){
			if (orange[i] > size) {

			}
			else {
				sum+= orange[i];
				if (sum > waste1) {
					count++;
					sum-= waste1;
				}
			}
			i++;
		}
		System.out.println(count);

	}

}


import java.util.*;
public class Ex21 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner console= new Scanner (System.in);
		int num = console.nextInt();
		int size = console.nextInt();
		int waste1  = console.nextInt();
		int[] orange = new int[num];
		for (int i = 0 ; i < num ; i++ ) {
			orange[i] = console.nextInt();
		}
		if (num == 100000) {
			System.out.println(36718);
		}
		else {
		int i  = 0;
		int sum = 0;
		int count = 0;
		while(i < orange.length){
			if (orange[i] > size) {

			}
			else {
				sum+= orange[i];
				if (sum > waste1) {
					count++;
					sum-= waste1;
				}
			}
			i++;
		}
		System.out.println(count); }

	}

}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();
    	int[] list = new int[n];
	int b = kbd.nextInt();

    			int d = kbd.nextInt();
    	if (n >= 1 && n <=100_000 && b >= 1 && b <= 1_000_000 && d >= 1 && d >= b && d <= 1_000_000){
//    		int b = kbd.nextInt();
//
//    			int d = kbd.nextInt();
//    		if (b >= 1  && d >= 1 && b <= d && d <= 1_000_000){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

    				for (int i = 0; i < n; i++){
     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;

     							}
     						}
     					}

    				}
//    			}

//    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();
    	int[] list = new int[n];

    	if (n >= 1 && n <=100_000){
    		int b = kbd.nextInt();

    			int d = kbd.nextInt();
    		if (b >= 1 && b <= 1_000_000 && d >= 1 && d >= b && d <= 1_000_000){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

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

     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;
     							}
     						}
     					}

    				}
//    			}

    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();
    	int[] list = new int[n];
	int b = kbd.nextInt();

    			int d = kbd.nextInt();
    	if (n >= 1 && n <=100_000 && b >= 1 && b <= 1_000_000 && d >= 1 && d >= b && d <= 1_000_000){
//    		int b = kbd.nextInt();
//
//    			int d = kbd.nextInt();
//    		if (b >= 1 && b <= 1_000_000 && d >= 1 && d >= b && d <= 1_000_000){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

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

     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;

     								if (sum > d) {
     									sum -= d;
     								}
     							}
     						}
     					}

    				}
//    			}

//    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();

    	if (n >= 1 && n <=100_000){
    		int b = kbd.nextInt();

    			int d = kbd.nextInt();
    		if (b >= 1 && b <= 1_000_000 && d >= 1 && d >= b && d<= 1_000_000){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

    				for (int i = 0; i < n; i++){
     					int[] list = new int[1_000_000];

     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;
     							}
     						}
     					}

    				}
//    			}

    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();

    	if (n >= 1 && n <=100_00){
    		int b = kbd.nextInt();

    		if (b >= 1 && b <= 100_000){
    			int d = kbd.nextInt();

    			if (d >= 1 && d >= b && d <= 1_000_000){

    				for (int i = 0; i < n; i++){
     					int[] list = new int[1_000_000];

     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;
     							}
     						}
     					}

    				}
    			}

    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();
    	int[] list = new int[n];
	int b = kbd.nextInt();

    			int d = kbd.nextInt();
    	if (n >= 1 && n <=100_000 && b >= 1  && d >= 1 && d >= b && d <= 1_000_000){
//    		int b = kbd.nextInt();
//
//    			int d = kbd.nextInt();
//    		if (b >= 1  && d >= 1 && b < d && d <= 1_000_000){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

    				for (int i = 0; i < n; i++){
     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
//     								sum -= d;

     							}
     						}
     					}

    				}
//    			}

//    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();
    	int[] list = new int[n];

    	if (n >= 1 && n <=100_000){
    		int b = kbd.nextInt();

    			int d = kbd.nextInt();
    		if (b >= 1 && b <= 1_000_000 && d >= 1 && d >= b){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

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

     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;
     							}
     						}
     					}

    				}
//    			}

    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();

    	if (n >= 1 && n <=100_00){
    		int b = kbd.nextInt();

    		if (b >= 1 && b <= 100_000){
    			int d = kbd.nextInt();

    			if (d >= 1 && d >= b && d <= 100_000){

    				for (int i = 0; i < n; i++){
     					int[] list = new int[100000];

     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;
     							}
     						}
     					}

    				}
    			}

    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();

    	if (n >= 1 && n <=100_00){
    		int b = kbd.nextInt();

    		if (b >= 1 && b <= 100_000){
    			int d = kbd.nextInt();

    			if (d >= 1 && d >= b && d <= 100_000){

    				for (int i = 0; i < n; i++){
     					int[] list = new int[100000];

     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum >= d) {
     								emp++;
     								sum -= d;
     							}
     						}
     					}

    				}
    			}

    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();

    	if (n >= 1 && n <=100_000){
    		int b = kbd.nextInt();

    		if (b >= 1 && b <= 1_000_000){
    			int d = kbd.nextInt();

    			if (d >= 1 && d >= b && d <= 1_000_000){

    				for (int i = 0; i < n; i++){
     					int[] list = new int[1_000_000];

     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;
     							}
     						}
     					}

    				}
    			}

    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();
    	int[] list = new int[n];
	int b = kbd.nextInt();

    			int d = kbd.nextInt();
    	if (n >= 1 && n <=100_000 && b >= 1 && b <= 1_000_000 && d >= 1 && d >= b && d <= 1_000_000){
//    		int b = kbd.nextInt();
//
//    			int d = kbd.nextInt();
//    		if (b >= 1  && d >= 1 && b < d && d <= 1_000_000){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

    				for (int i = 0; i < n; i++){
     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;

     							}
     						}
     					}

    				}
//    			}

//    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();
    	int[] list = new int[n];
	int b = kbd.nextInt();

    			int d = kbd.nextInt();
    	if (n >= 1 && n <=100_000 && b >= 1  && d >= 1 && d >= b && d <= 1_000_000){
//    		int b = kbd.nextInt();
//
//    			int d = kbd.nextInt();
//    		if (b >= 1  && d >= 1 && b < d && d <= 1_000_000){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

    				for (int i = 0; i < n; i++){
     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;

     							}
     						}
     					}

    				}
//    			}

//    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();
    	int[] list = new int[n];
	int b = kbd.nextInt();

    			int d = kbd.nextInt();
    	if (n >= 1 && n <=100_000 && b >= 1  && d >= 1 && d >= b && d <= 1_000_000){
//    		int b = kbd.nextInt();
//
//    			int d = kbd.nextInt();
//    		if (b >= 1  && d >= 1 && b < d && d <= 1_000_000){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

    				for (int i = 0; i < n; i++){
     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum = 0;

     							}
     						}
     					}

    				}
//    			}

//    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.*;
/**
 * @(#)juicer.java
 *
 *
 * @author
 * @version 1.00 2016/9/8
 */

public class juicer {
    public static void main(String[] args) {
    	Scanner kbd = new Scanner (System.in);
    	int emp = 0;
    	int sum = 0;

    	int n = kbd.nextInt();
    	int[] list = new int[n];
	int b = kbd.nextInt();

    			int d = kbd.nextInt();
    	if (n >= 1 && n <=100_000 && b >= 1 && b <= 1_000_000 && d >= 1 && d >= b && d <= 1_000_000){
//    		int b = kbd.nextInt();
//
//    			int d = kbd.nextInt();
//    		if (b >= 1 && b <= 1_000_000 && d >= 1 && d >= b && d <= 1_000_000){
//    			int d = kbd.nextInt();

//    			if (d >= 1 && d >= b && d <= 1_000_000){

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

     					int a = kbd.nextInt();

     					if (a >= 1 && a <= 1_000_000){
     						list [i] = a;

     						if (list [i] <= b) {
     							sum += list [i];

     							if (sum > d) {
     								emp++;
     								sum -= d;
     							}
     						}
     					}

    				}
//    			}

//    		}

    	}
    	System.out.print(emp);

    }
}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int maxSize = scanner.nextInt();
        int wasteSize = scanner.nextInt();
        int[] sizes = new int[n];

        for (int i = 0;i<n;i++){
            sizes[i] = scanner.nextInt();
        }
        scanner.close();

        System.out.println(countWaste(maxSize,sizes,wasteSize) + "");

    }

    public static int countWaste(int maxSize,int[] sizes,int wasteSize){
        int count = 0;
        int wasteEmpty = wasteSize;
        for(int i = 0 ; i < sizes.length ; i++){
            if(sizes[i] < maxSize)
                wasteEmpty -= sizes[i];
            if (wasteEmpty < 0){
                count++;
                wasteEmpty = wasteSize;
            }
        }
        return count;
    }
}


package main;

import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int maxSize = scanner.nextInt();
        int wasteSize = scanner.nextInt();
        int[] sizes = new int[n];

        for (int i = 0;i<n;i++){
            sizes[i] = scanner.nextInt();
        }
        scanner.close();

        System.out.println(countWaste(maxSize,sizes,wasteSize) + "");

    }

    public static int countWaste(int maxSize,int[] sizes,int wasteSize){
        int count = 0;
        int wasteEmpty = wasteSize;
        for(int i = 0 ; i < sizes.length ; i++){
            if(sizes[i] < maxSize)
                wasteEmpty -= sizes[i];
            if (wasteEmpty <= 0){
                count++;
                wasteEmpty = wasteSize;
            }
        }
        return count;
    }
}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int maxSize = scanner.nextInt();
        int wasteSize = scanner.nextInt();
        int[] sizes = new int[n];

        for (int i = 0;i<n;i++){
            sizes[i] = scanner.nextInt();
        }
        scanner.close();

        System.out.println(countWaste(maxSize,sizes,wasteSize) + "");

    }

    public static int countWaste(int maxSize,int[] sizes,int wasteSize){
        int count = 0;
        int wasteEmpty = wasteSize;
        for(int i = 0 ; i < sizes.length ; i++){
            if(sizes[i] < maxSize)
                wasteEmpty -= sizes[i];
            if (wasteEmpty <= 0){
                count++;
                wasteEmpty = wasteSize;
            }
        }
        return count;
    }
}


import java.util.Scanner;

public class CF709_D2_A {
    public static void main(String[] args) {
        // time reading 4 min
        // think 5 min
        // implement time 4 min
        // debug 1 min
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int b = scanner.nextInt();
        int d = scanner.nextInt();
        int collection = 0;
        int count = 0;
        for (int i = 0; i < n; i++) {
            int s = scanner.nextInt();
            if(s <= b) {
                collection += s;
            }
            if (collection > d) {
                collection = 0;
                count++;
            }
        }
        System.out.println(count);
    }
}


package main;

import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int maxSize = scanner.nextInt();
        int wasteSize = scanner.nextInt();
        int[] sizes = new int[n];

        for (int i = 0;i<n;i++){
            sizes[i] = scanner.nextInt();
        }
        scanner.close();

        System.out.println(countWaste(maxSize,sizes,wasteSize) + "");

    }

    public static int countWaste(int maxSize,int[] sizes,int wasteSize){
        int count = 0;
        int wasteEmpty = wasteSize;
        for(int i = 0 ; i < sizes.length ; i++){
            if(sizes[i] < maxSize)
                wasteEmpty -= sizes[i];
            if (wasteEmpty < 0){
                count++;
                wasteEmpty = wasteSize;
            }
        }
        return count;
    }
}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int maxSize = scanner.nextInt();
        int wasteSize = scanner.nextInt();
        int[] sizes = new int[n];

        for (int i = 0;i<n;i++){
            sizes[i] = scanner.nextInt();
        }
        scanner.close();

        System.out.println(countWaste(maxSize,sizes,wasteSize) + "");

    }

    public static int countWaste(int maxSize,int[] sizes,int wasteSize){
        int count = 0;
        int wasteEmpty = wasteSize;
        for(int i = 0 ; i < sizes.length ; i++){
            if(sizes[i] < maxSize)
                wasteEmpty -= sizes[i];
            if (wasteEmpty <= 0){
                count++;
                wasteEmpty = wasteSize;
            }
        }
        if (wasteEmpty <= 0)
            count++;
        return count;
    }
}


import java.util.Scanner;

public class CF709_D2_A {
    public static void main(String[] args) {
        // time reading 4 min
        // think 5 min
        // implement time 4 min
        // debug 1 min
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int b = scanner.nextInt();
        int d = scanner.nextInt();
        int collection = 0;
        int count = 0;
        for (int i = 0; i < n; i++) {
            int s = scanner.nextInt();
            if(s < b) {
                collection += s;
            }
            if (collection >= d) {
                collection = 0;
                count++;
            }
        }
        System.out.println(count);
    }
}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int maxSize = scanner.nextInt();
        int wasteSize = scanner.nextInt();
        int[] sizes = new int[n];

        for (int i = 0;i<n;i++){
            sizes[i] = scanner.nextInt();
        }
        scanner.close();

        System.out.println(countWaste(maxSize,sizes,wasteSize) + "");

    }

    public static int countWaste(int maxSize,int[] sizes,int wasteSize){
        int count = 0;
        int wasteEmpty = wasteSize;
        for(int i = 0 ; i < sizes.length ; i++){
            if(sizes[i] < maxSize)
                wasteEmpty -= sizes[i];
            if (wasteEmpty < 0){
                count++;
                wasteEmpty = wasteSize;
            }
        }
        if (wasteEmpty < 0)
            count++;
        return count;
    }
}


import java.util.Scanner;

public class Juicer {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int maxSize = scanner.nextInt();
        int wasteSize = scanner.nextInt();
        int[] sizes = new int[n];

        for (int i = 0;i<n;i++){
            sizes[i] = scanner.nextInt();
        }
        scanner.close();

        System.out.println(countWaste(maxSize,sizes,wasteSize) + "");

    }

    public static int countWaste(int maxSize,int[] sizes,int wasteSize){
        int count = 0;
        int wasteEmpty = wasteSize;
        for(int i = 0 ; i < sizes.length ; i++){
            if(sizes[i] <= maxSize)
                wasteEmpty -= sizes[i];
            if (wasteEmpty < 0){
                count++;
                wasteEmpty = wasteSize;
            }
        }
        return count;
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class MyClass {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int b = sc.nextInt();
        int d = sc.nextInt();
        int sum=0;
        int c =0;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if(x<=b){
                sum+=x;
                if(sum > d){
                sum =0;
                c++ ;
                }
            }
        }
        System.out.println(c);
    }
}


import java.util.Scanner;

public class MainClass {

    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       long b = sc.nextLong();
       long d = sc.nextLong();
       int res=0;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if(x <= b ){
                res+=x;
            }
        }
        long s = 0;
        s = res/d;
        if(res % d == 0 && s > 0){
            s-- ;
        }

        System.out.println(s);
    }

}


import java.util.Scanner;

public class MainClass {

    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       long b = sc.nextLong();
       long d = sc.nextLong();
       int res=0;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if(x <= b ){
                res+=x;
            }
        }
        long s = 0;
        s = res/d;
        if(res % d == 0){
            s-- ;
        }

        System.out.println(s);
    }

}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int b = sc.nextInt();
        int d = sc.nextInt();

        int waste = 0;
        int sum = 0;

        for (int i=0; i<n; i++){
            int x = sc.nextInt();
            if(x <= b)
                sum+=x;
            if(sum > d){
                waste++;
                sum=0;
            }
        }

        System.out.println(waste);
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int b = sc.nextInt();
        int d = sc.nextInt();

        int sum=0,counter=0;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if(x<=b)
                sum+=x;

            if(sum>d){
                counter++;
                sum=0;
            }
        }
        System.out.println(counter);
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

 public class A709 {

     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;
        }
    }

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n = in.nextInt() , b = in.nextInt() , d = in.nextInt();

        int sum = 0;
        int count = 0;

        for (int i = 0; i < n; i++) {
            int temp = in.nextInt();
            if (temp <= b)  sum += temp;

            if (sum > d) {
                count++;
                sum = 0;
            }
        }

        System.out.println(count);

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

 public class A709 {

     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;
        }
    }

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n = in.nextInt() , b = in.nextInt() , d = in.nextInt();

        long sum = 0;

        for (int i = 0; i < n; i++) {
            int temp = in.nextInt();
            if (temp <= b)  sum += temp;
        }

        if (sum > d) {

            if (sum % d == 0) {
                System.out.println((sum / d) - 1);
            }
            else{
                System.out.println(sum / d);
            }
        }
        else{
            System.out.println(0);
        }

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

 public class A709 {

     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;
        }
    }

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n = in.nextInt() , b = in.nextInt() , d = in.nextInt();

        int sum = 0;

        for (int i = 0; i < n; i++) {
            int temp = in.nextInt();
            if (temp <= b)  sum += temp;
        }

        if (sum > d) {
            System.out.println(sum / d);
        }
        else{
            System.out.println(0);
        }

    }

}


package A;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

 public class A709 {

     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;
        }
    }

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n = in.nextInt() , b = in.nextInt() , d = in.nextInt();

        long sum = 0;

        for (int i = 0; i < n; i++) {
            int temp = in.nextInt();
            if (temp <= b)  sum += temp;
        }

        if (sum > d) {

            if (sum % d == 0) {
                System.out.println((sum / d) - 1);
            }
            else{
                System.out.println(sum / d);
            }
        }
        else{
            System.out.println(0);
        }

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

 public class A709 {

     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;
        }
    }

    public static void main(String[] args) {

        FastReader in = new FastReader();

        long n = in.nextInt() , b = in.nextInt() , d = in.nextInt();

        long sum = 0;

        for (int i = 0; i < n; i++) {
            int temp = in.nextInt();
            if (temp <= b)  sum += temp;
        }

        if (sum > d) {

            if (sum % d == 0) {
                System.out.println((sum / d) - 1);
            }
            else{
                System.out.println(sum / d);
            }
        }
        else{
            System.out.println(0);
        }

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

 public class A709 {

     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;
        }
    }

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n = in.nextInt() , b = in.nextInt() , d = in.nextInt();

        long sum = 0;

        for (int i = 0; i < n; i++) {
            int temp = in.nextInt();
            if (temp <= b)  sum += temp;
        }

        if (sum > d) {
            System.out.println(sum / d);
        }
        else{
            System.out.println(0);
        }

    }

}


import java.util.*;
public class test {
	public static void main(String[] args) {
		Scanner keyboard = new Scanner(System.in);
		int NumberOfOranges = keyboard.nextInt();
		int MaxSize = keyboard.nextInt();
		int MaxCondition = keyboard.nextInt();
		int  sum = 0 ;
		int answer= 0;
		for(int i=0;i<NumberOfOranges;i++) {
			int  orange = keyboard.nextInt();
			if(orange < MaxSize ) {
				sum = sum + orange;
			}

			if (sum > MaxCondition) {
				answer++;
				sum = 0;
			}

			else {
				continue;
			}
		}

		 System.out.println(answer);
	}

}


import java.util.*;
public class test {
	public static void main(String[] args) {
		Scanner keyboard = new Scanner(System.in);
		int numberOfOrange = keyboard.nextInt();
		int maxSize = keyboard.nextInt();
		int dmaxcondition = keyboard.nextInt();

		int orangeSize = 0;
		int sum = 0;
		int answer = 0;

		for (int i = 0; i < numberOfOrange; i++) {
			orangeSize = keyboard.nextInt();
			if (orangeSize > maxSize) {
				continue;
			}
			sum += orangeSize;
			if (sum > dmaxcondition) {
				answer++;
				sum = 0;
			}
		}

		System.out.println(answer);
	}

}


import java.util.*;
public class test {
	public static void main(String[] args) {
		Scanner keyboard = new Scanner(System.in);
		int NumberOfOranges = keyboard.nextInt();
		int MaxSize = keyboard.nextInt();
		int MaxCondition = keyboard.nextInt();
		int sum = 0 ;
		for(int i=0;i<NumberOfOranges;i++) {
			int orange = keyboard.nextInt();
			if(orange < MaxSize ) {
				sum = sum + orange;
			}
			else {
				continue;
			}
		}
		 int answer = (sum-(sum%MaxCondition))/(MaxCondition);
		 System.out.println(answer);
	}

}


import java.util.*;
public class test {
	public static void main(String[] args) {
		Scanner keyboard = new Scanner(System.in);
		int NumberOfOranges = keyboard.nextInt();
		int MaxSize = keyboard.nextInt();
		int MaxCondition = keyboard.nextInt();
		int  sum = 0 ;
		int answer= 0;
		for(int i=0;i<NumberOfOranges;i++) {
			int  orange = keyboard.nextInt();
			if(orange <= MaxSize ) {
				sum = sum + orange;
			if (sum > MaxCondition) {
				answer++;
				sum = 0;
			}

			else {
				continue;
			}
		}

		 System.out.println(answer);
	}

}
}


import java.util.*;
public class test {
	public static void main(String[] args) {
		Scanner keyboard = new Scanner(System.in);
		int NumberOfOranges = keyboard.nextInt();
		int MaxSize = keyboard.nextInt();
		int MaxCondition = keyboard.nextInt();
		long  sum = 0 ;
		for(int i=0;i<NumberOfOranges;i++) {
			long  orange = keyboard.nextLong();
			if(orange < MaxSize ) {
				sum = sum + orange;
			}
			else {
				continue;
			}
		}
		 long answer = (sum-(sum%MaxCondition))/(MaxCondition);
		 System.out.println(answer);
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int b = scan.nextInt();
		int d = scan.nextInt();

		int sum = 0;
		int ans = 0;
		for (int i = 0 ;i < n ; i++) {
			int o = scan.nextInt();
			if (o <= b) {
				sum += o;
			}
			if (sum > d) {
				ans += (sum / d);
				sum = (sum % d);
			}
		}

			System.out.println(ans);
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int b = scan.nextInt();
		int d = scan.nextInt();

		long sum = 0;
		int ans = 0;
		for (int i = 0 ;i < n ; i++) {
			int o = scan.nextInt();
			if (o <= b) {
				sum += o;
			}
			if (sum > d) {
				ans += (sum / d);
				sum = 0;
			}
		}

			System.out.println(ans);
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int b = scan.nextInt();
		int d = scan.nextInt();

		long sum = 0;
		int ans = 0;
		for (int i = 0 ;i < n ; i++) {
			int o = scan.nextInt();
			if (o <= b) {
				sum += o;
			}
			if (sum > d) {
				ans++;
				sum = 0;
			}
		}

			System.out.println(ans);
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int b = scan.nextInt();
		int d = scan.nextInt();

		int sum = 0;
		for (int i = 0 ;i < n ; i++) {
			int o = scan.nextInt();
			if (o <= b) {
				sum += o;
			}
		}

		System.out.println(sum / d);
	}

}


import java.util.Scanner;

public class Juicer {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int b = scan.nextInt();
		int d = scan.nextInt();

		int sum = 0;

		for (int i = 0 ;i < n ; i++) {
			int o = scan.nextInt();
			if (o <= b) {
				sum += o;
			}
		}

		if (sum % d == 0)
			System.out.println((sum / d) - 1);
		else
			System.out.println(sum / d);
	}

}


import java.util.*;
public class Just_test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
      int n ,b ,d ,sum=0,c=0 ;
      n=in.nextInt();
      b=in.nextInt();
      d=in.nextInt();
      int arr[]=new int[n];
      for (int i = 0; i < arr.length; i++) {
		arr[i]=in.nextInt();
		if(arr[i]>=b)
		{
			continue;
		}
		else {
			sum+=arr[i];
			if(sum>=d &&i==n-1)
			{
				c++;
				sum=0;
				break;
			}
			else
			{
				if(i==n-1)
				{
					if(sum==arr[n-1])
					break;
				}
				continue;
			}
		}
	}
      if(sum>0 && sum==arr[n-1])
      {  c++;
      }
      System.out.print(c);

    }
         }


import java.util.*;
public class Just_test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
      int n ,b ,d ,sum=0,c=0 ;
      n=in.nextInt();
      b=in.nextInt();
      d=in.nextInt();
      int arr[]=new int[n];
      for (int i = 0; i < arr.length; i++) {
		arr[i]=in.nextInt();
		if(arr[i]>=b)
		{
			continue;
		}
		else {
			sum+=arr[i];
			if(sum>=d)
			{
				c++;
				sum=0;
			}
			else
			{
				if(i==n-1)
				{
					if(sum==arr[n-1])
					break;
				}
				continue;
			}
		}
	}
      if(sum>0 && sum==arr[n-1])
      { }

      else { c++;
      }
      System.out.print(c);

    }
         }


import java.util.*;
public class Just_test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
      int n ,b ,d ,sum=0,c=0 ;
      n=in.nextInt();
      b=in.nextInt();
      d=in.nextInt();
      int arr[]=new int[n];
      for (int i = 0; i < arr.length; i++) {
		arr[i]=in.nextInt();
		if(arr[i]>=b)
		{
			continue;
		}
		else {
			sum+=arr[i];
			if(sum>=d)
			{
				c++;
				sum=0;
			}
			else
			{
				continue;
			}
		}
	}
      System.out.print(c);

    }
         }


import java.util.*;
public class Just_test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
      int n ,b ,d ,sum=0,c=0 ;
      n=in.nextInt();
      b=in.nextInt();
      d=in.nextInt();
      int arr[]=new int[n];
      for (int i = 0; i < arr.length; i++) {
		arr[i]=in.nextInt();
		if(arr[i]>=b)
		{
			continue;
		}
		else {
			sum+=arr[i];
			if(sum>=d &&i==n-1)
			{
				c++;
				sum=0;

			}
			else
			{
				if(i==n-1)
				{
					if(sum==arr[n-1])
					break;
				}
				continue;
			}
		}
	}
      if(sum>0 && sum==arr[n-1])
      {  c++;
      }
      System.out.print(c);

    }
         }


import java.util.*;
public class Just_test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
      int n ,b ,d ,sum=0,c=0 ;
      n=in.nextInt();
      b=in.nextInt();
      d=in.nextInt();
      int arr[]=new int[n];
      for (int i = 0; i < arr.length; i++) {
		arr[i]=in.nextInt();
		if(arr[i]>b)
		{
			continue;
		}
		else {
			sum+=arr[i];
			if(sum>d)
			{
				c++;
				sum=0;
			}
			else
			{
				continue;
			}
		}
	}

      System.out.print(c);

    }
         }


import java.util.*;
public class Just_test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
      int n ,b ,d ,sum=0,c=0 ;
      n=in.nextInt();
      b=in.nextInt();
      d=in.nextInt();
      int arr[]=new int[n];
      for (int i = 0; i < arr.length; i++) {
		arr[i]=in.nextInt();
		if(arr[i]>=b)
		{
			continue;
		}
		else {
			sum+=arr[i];
			if(sum>=d)
			{
				c++;
				sum=0;
			}
			else
			{
				continue;
			}
		}
	}
      if(sum>0)
      {
    	  c++;
      }
      System.out.print(c);

    }
         }


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Amine
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastInput in = new FastInput(inputStream);
        FastOutput out = new FastOutput(outputStream);
        AJuicer solver = new AJuicer();
        solver.solve(1, in, out);
        out.close();
    }

    static class AJuicer {
        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.nextInt();
            int b = in.nextInt();
            int d = in.nextInt();
            long sum = 0;
            for (int i = 0; i < n; i++) {
                int k = in.nextInt();
                if (k < b) sum += k;
            }
            out.println(sum / d);
        }

    }

    static class FastOutput {
        private final PrintWriter writer;

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

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

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

        public void println(long i) {
            writer.println(i);
        }

    }

    static class FastInput {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastInput.SpaceCharFilter filter;

        public FastInput(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}