#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define read freopen("in.in","r",stdin)
#define write freopen("out.out","w",stdout)
#define FastIO ios::sync_with_stdio(0)
#define mod 1000000007
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
const int N = 1003;
int vis[N],dis[N];
vector<vi>adjlist;
int adjmatrix[N][N];
set<ii>edges;
vi topsort;
int n;
void dfs(int node) {
	if (vis[node])return;
	vis[node] = 1;
	for (int i = 0; i < adjlist[node].size(); i++)
	{
		int child = adjlist[node][i];
		if (!vis[child])
			dfs(child);
	}
	topsort.push_back(node);
}
int shorttestbath() {
	memset(vis, 0, sizeof vis);
	memset(dis, INT_MAX, sizeof dis);
	for (int i = 0; i < topsort.size(); i++) {
		int node = topsort[i];

		for (int i = 0; i < adjlist[node].size(); i++)
		{
			int child = adjlist[node][i];
			if (!vis[child])
				dis[child] = min(dis[child], dis[node] - 1);
		}
	}
	int ans = INT_MAX;
	for (int i = 0; i < n; i++)
		ans = min(ans, dis[i]);
	return -ans;
}
int main() {
	FastIO;
#ifndef ONLINE_JUDGE
	read; write;
#endif
	int m; cin >> n >> m;
	int a, b;
	adjlist.resize(n + 1);
	for (int i = 0; i < m; i++)
	{
		cin >> a;
		for (int j = 0; j < n - 1; j++) {
			cin >> b;
			if (b > a)
				edges.insert({ a,b });
			a = b;
		}
		for (auto it = edges.begin(); it != edges.end(); it++)
		{
			if (it->second > it->first && !adjmatrix[it->first][it->second]) {

				adjlist[it->first].push_back(it->second);
				adjmatrix[it->first][it->second] = 1;
			}
		}
		edges.clear();
	}
	for (int i = 1; i <= n; i++)
		dfs(i);
	reverse(topsort.begin(), topsort.end());
	int ans = shorttestbath();
	cout << ans << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define read freopen("in.in","r",stdin)
#define write freopen("out.out","w",stdout)
#define FastIO ios::sync_with_stdio(0)
#define mod 1000000007
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
const int N = 1003;
int memo[N][N];
string grid[N];
string s1, s2;
int dp(int i, int j) {
	if (i<0 || j<0)
		return 0;
	int &ret = memo[i][j];
	if (ret != -1)return ret;

	if (s1[i] == s2[j])
		ret = dp(i - 1, j - 1) + 1;
	else ret = max(dp(i, j - 1), dp(i - 1, j));
	return ret;
}
int main() {
	FastIO;
#ifndef ONLINE_JUDGE
	read; write;
#endif
	int n, k; cin >> n >> k;
	char x;
	for (int i = 0; i < k; i++)
		for (int j = 0; j < n; j++) {
			cin >> x;
			grid[i].push_back(x);
		}
	int ans = 100000;
	s1 = grid[0];
	for (int i = 1; i < k; i++) {
		s2 = grid[i];
		memset(memo, -1, sizeof memo);
		ans = min(ans, dp(s1.size() - 1, s2.size() - 1));
	}
	cout << ans << endl;

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define read freopen("in.in","r",stdin)
#define write freopen("out.out","w",stdout)
#define FastIO ios::sync_with_stdio(0)
#define mod 1000000007
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
const int N = 1003;
int vis[N],dis[N],grid[10][N], pos[10][N];
vector<vi>adjlist;
set<ii>edges;
vi topsort;
int n;
void dfs(int node) {
	if (vis[node])return;
	vis[node] = 1;
	for (int i = 0; i < adjlist[node].size(); i++)
	{
		int child = adjlist[node][i];
		if (!vis[child])
			dfs(child);
	}
	topsort.push_back(node);
}
int shorttestbath() {
	memset(vis, 0, sizeof vis);
	memset(dis, INT_MAX, sizeof dis);
	for (int i = 0; i < topsort.size(); i++) {
		int node = topsort[i];

		for (int j=0;j<adjlist[node].size();j++)
		{
			int child = adjlist[node][j];

			if (!vis[child])
				dis[child] = min(dis[child] , dis[node] - 1);
		}
	}
	int ans = INT_MAX;
	for (int i = 0; i < n; i++)
		ans = min(ans, dis[i]);
	return -ans;
}
int main() {
	FastIO;
#ifndef ONLINE_JUDGE
	read; write;
#endif
	int m; cin >> n >> m;
	int a, b;
	adjlist.resize(n+1);
	for (int i = 0; i < m; i++)
		for (int j = 0; j < n; j++) {
			cin >> grid[i][j];
			pos[i][grid[i][j]] = j;
		}
	for (int i = 1; i <=n; i++)
		for (int j = 1; j <=n; j++)
		{
			if (i == j)continue;
			bool can = true;
			for (int k = 0; k < m; k++)
				if (pos[k][i] > pos[k][j])can = false;
			if (can)adjlist[i].push_back(j);
		}

	for (int i = 1; i <= n; i++)
		dfs(i);
	reverse(topsort.begin(), topsort.end());
	int ans = shorttestbath();
	cout << ans << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1005, MAXK = 10;
int p[MAXK][MAXN];
vector<int> adj[MAXN];
bitset<MAXN> vis;

int dfs(int u) {
  int len = 0;
  vis[u] = 1;
  for (int v : adj[u]) if (!vis[v]) {
    len = max(len, dfs(v));
  }
  return 1 + len;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      cin >> p[i][j];
    }
  }
  for (int num = 1; num <= n; num++) {
    vector<int> cnt(n + 1);
    for (int i = 0; i < k; i++) {
      for (int j = 0; j < n; j++) {
        if (p[i][j] == num) {
          break;
        }
        cnt[p[i][j]]++;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (cnt[i] == k) {
        adj[i].emplace_back(num);
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    vis.reset();
    ans = max(ans, dfs(i));
  }
  cout << ans << "\n";
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1005, MAXK = 10;
int p[MAXK][MAXN];
vector<int> adj[MAXN];

int dfs(int u) {
  int len = 0;
  for (int v : adj[u]) {
    len = max(len, dfs(v));
  }
  return 1 + len;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      cin >> p[i][j];
    }
  }
  for (int num = 1; num <= n; num++) {
    vector<int> cnt(n + 1);
    for (int i = 0; i < k; i++) {
      for (int j = 0; j < n; j++) {
        if (p[i][j] == num) {
          break;
        }
        cnt[p[i][j]]++;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (cnt[i] == k) {
        adj[i].emplace_back(num);
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, dfs(i));
  }
  cout << ans << "\n";
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1005, MAXK = 10;
int p[MAXK][MAXN];
vector<int> adj[MAXN];

int dfs(int u) {
  int len = 0;
  for (int v : adj[u]) {
    len = max(len, dfs(v));
  }
  return 1 + len;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      cin >> p[i][j];
    }
  }
  for (int num = 1; num <= n; num++) {
    int min_idx = n, who;
    for (int i = 0; i < k; i++) {
      for (int j = 0; j < n; j++) {
        if (p[i][j] == num) {
          if (j < min_idx) {
            min_idx = j;
            who = i;
          }
          break;
        }
      }
    }
    for (int i = 0; i < min_idx; i++) {
      adj[p[who][i]].emplace_back(num);
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, dfs(i));
  }
  cout << ans << "\n";
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1005, MAXK = 10;
int p[MAXK][MAXN];
vector<int> adj[MAXN];

int dfs(int u) {
  int len = 0;
  for (int v : adj[u]) {
    len = max(len, dfs(v));
  }
  return 1 + len;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      int x;
      cin >> x;
      p[i][x] = j;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) {
        continue;
      }
      bool ok = true;
      for (int perm = 0; perm < k; perm++) {
        if (p[perm][j] < p[perm][i]) {
          ok = false;
          break;
        }
      }
      if (ok) {
        adj[i].push_back(j);
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, dfs(i));
  }
  cout << ans << "\n";
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1005, MAXK = 10;
int a[MAXK][MAXN], pos[MAXK][MAXN];
int dp[MAXN];

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
      pos[i][a[i][j]] = j;
    }
  }
  int ans = 1;
  for (int i = 1; i <= n; i++) {
    dp[i] = 1;
    for (int j = 1; j < i; j++) {
      bool ok = true;
      for (int seq = 1; seq <= k; seq++) {
        if (pos[seq][a[1][j]] > pos[seq][a[1][i]]) {
          ok = false;
          break;
        }
      }
      if (ok) {
        dp[i] = max(dp[i], dp[j] + 1);
        ans = max(ans, dp[i]);
      }
    }
  }
  cout << ans << "\n";
  return 0;
}


#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int a[1010][5];
vector<pair<int, int>> vt;
int dp[1010];
int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++)
	{
		for (int y = 0; y< n; y++)
		{
			int q;
			scanf("%d", &q);
			a[q][i] = y;
		}
	}
	for (int i = 1; i <= n; i++)
	{
		vt.push_back({ a[i][0],i });
	}
	sort(vt.begin(), vt.end());
	int dap = 0;
	for (int i = 0; i < vt.size(); i++)
	{
		int gap = 1;
		for (int y = 1; y <=n; y++)
		{
			int cnt = 0;
			for (int z = 0; z < m; z++)
			{
				if (a[vt[i].second][z] > a[y][z])
					cnt++;
			}
			if (cnt == m)
			{
				gap = max(dp[y] + 1, gap);
			}
		}
		dp[vt[i].second] = gap;
		dap = max(dap, gap);
	}

	printf("%d", dap);
}


#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int a[1010][5];
vector<pair<int, int>> vt;
int dp[1010];
int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++)
	{
		for (int y = 0; y< n; y++)
		{
			int q;
			scanf("%d", &q);
			a[q][i] = y;
		}
	}
	for (int i = 1; i <= n; i++)
	{
		vt.push_back({ a[i][0],i });
	}
	sort(vt.begin(), vt.end());
	int dap = 0;
	for (int i = 0; i < vt.size(); i++)
	{
		int gap = 1;
		for (int y = 0; y < vt[i].second; y++)
		{
			int cnt = 0;
			for (int z = 0; z < m; z++)
			{
				if (a[i][z] > a[y][z])
					cnt++;
			}
			if (cnt == m)
			{
				gap = max(dp[y] + 1, gap);
			}
		}
		dp[vt[i].second] = gap;
		dap = max(dap, gap);
	}

	printf("%d", dap);
}


#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int a[1010][5];
vector<pair<int, int>> vt;
int dp[1010];
int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++)
	{
		for (int y = 0; y< n; y++)
		{
			int q;
			scanf("%d", &q);
			a[q][i] = y;
		}
	}
	for (int i = 1; i <= n; i++)
	{
		vt.push_back({ a[i][0],i });
	}
	sort(vt.begin(), vt.end());
	int dap = 0;
	for (int i = 0; i < vt.size(); i++)
	{
		int gap = 1;
		for (int y = 1; y <=n; y++)
		{
			int cnt = 0;
			for (int z = 0; z < m; z++)
			{
				if (a[i][z] > a[y][z])
					cnt++;
			}
			if (cnt == m)
			{
				gap = max(dp[y] + 1, gap);
			}
		}
		dp[vt[i].second] = gap;
		dap = max(dap, gap);
	}

	printf("%d", dap);
}


#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int a[1010][5];
vector<pair<int, int>> vt;
int dp[1010];
int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++)
	{
		for (int y = 0; y< n; y++)
		{
			int q;
			scanf("%d", &q);
			a[q][i] = y;
		}
	}
	for (int i = 1; i <= n; i++)
	{
		vt.push_back({ a[i][0],i });
	}
	sort(vt.begin(), vt.end());
	int dap = 0;
	for (int i = 0; i < vt.size(); i++)
	{
		int gap = 1;
		for (int y = 1; y <=N; y++)
		{
			int cnt = 0;
			for (int z = 0; z < m; z++)
			{
				if (a[i][z] > a[y][z])
					cnt++;
			}
			if (cnt == m)
			{
				gap = max(dp[y] + 1, gap);
			}
		}
		dp[vt[i].second] = gap;
		dap = max(dap, gap);
	}

	printf("%d", dap);
}


#include<cstdio>
#include<algorithm>
using namespace std;
int a[1010][5];
int dp[1010];
int main() {
	int n, m;
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++)
	{
		for (int y = 0; y< n; y++)
		{
			int q;
			scanf("%d", &q);
			a[q][i] = y;
		}
	}
	int dap = 0;
	for (int i = 1; i <= n; i++)
	{
		int gap = 1;
		for (int y = 1; y < i; y++)
		{
			int cnt = 0;
			for (int z = 0; z < m; z++)
			{
				if (a[i][z] > a[y][z])
					cnt++;
			}
			if (cnt == m)
				gap = max(gap, dp[y]+1);
		}
		dp[i] = gap;
		dap = max(dap, dp[i]);
	}
	printf("%d", dap);
}


#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 100000000000000
//INF - 1e14
#define vi vector<ll>
#define PB push_back
#define pll pair<ll,ll>
#define vpll vector<pair<ll,ll> >
#define fer(i, a, n) for( ll i = a; i <= n; i++)
#define fdr(i, a, n) for( ll i = a; i >= n; i--)
#define inint(i) ll i;cin >> i
#define invec(n,v) vi v(n); fer(i,0,n-1) cin >> v[i]
#define insvec(n,v) inint(n); vi v(n); fer(i,0,n-1) cin >> v[i]
#define MK2DV(v,row,col,val) vector<vector<ll> > v(row, vector<ll>(col,val))
#define matrix vector<vector<ll> >
#define printpartition cout << "-------------------------------------------------------------" << endl;
#define printmat(mat,row,col) cout << #mat << "::" << endl; fer(i,0,row-1)fer(j,0,col-1)cout << mat[i][j] << " \n"[j == col-1]; printpartition;
using namespace std;
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
ll fast_pow(ll base, ll exp, ll M = MOD) { base = base % M; ll result=1; while(exp>0) { if(exp % 2 ==1) result=(result * base)%M; base=(base*base)%M; exp=exp/2; } return result; }
ll modInverse(ll A,ll M = MOD) { return fast_pow(A,M-2,M); } // only when M is prime
ll n;
bool vis[1001];
ll dis[1001];
ll dfs(vector<vector<ll> > &adj, ll src) {
    for(auto nbr : adj[src]) {
        dis[src] = max(dis[src], dfs(adj,nbr)+1);
    }
    return dis[src];
}
int main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
    memset(vis,false,sizeof(vis));
    ll k;
    cin >> n >> k;
    MK2DV(mat,k,n,0);
    MK2DV(mp,k,n+1,0);
    fer(i,0,k-1) {
        fer(j,0,n-1) {
            cin >> mat[i][j];
            mp[i][mat[i][j]] = j;
        }
    }
    vector<vector<ll> > adj(n+1);
    fer(i,0,n-2) {
        fer(j,i+1,n-1) {
            bool insert = true;
            fer(col,0,k-1) {
                if(mp[col][mat[0][j]] < mp[col][mat[0][i]]) {
                    insert = false;
                    break;
                }
            }
            if(insert) {
                adj[mat[0][i]-1].push_back(mat[0][j]-1);
            }
        }
    }
    fer(i,0,n-1) if(adj[i].size() == 0) dis[i] = 1;
    fer(i,0,n-1) {
        adj[n].push_back(i);
    }
    ll ans = INT_MIN;
    dfs(adj,n);
    fer(i,0,n-1) {
        ans = max(ans,dis[i]);
    }
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 100000000000000
//INF - 1e14
#define vi vector<ll>
#define PB push_back
#define pll pair<ll,ll>
#define vpll vector<pair<ll,ll> >
#define fer(i, a, n) for( ll i = a; i <= n; i++)
#define fdr(i, a, n) for( ll i = a; i >= n; i--)
#define inint(i) ll i;cin >> i
#define invec(n,v) vi v(n); fer(i,0,n-1) cin >> v[i]
#define insvec(n,v) inint(n); vi v(n); fer(i,0,n-1) cin >> v[i]
#define MK2DV(v,row,col,val) vector<vector<ll> > v(row, vector<ll>(col,val))
#define matrix vector<vector<ll> >
#define printpartition cout << "-------------------------------------------------------------" << endl;
#define printmat(mat,row,col) cout << #mat << "::" << endl; fer(i,0,row-1)fer(j,0,col-1)cout << mat[i][j] << " \n"[j == col-1]; printpartition;
using namespace std;
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
ll fast_pow(ll base, ll exp, ll M = MOD) { base = base % M; ll result=1; while(exp>0) { if(exp % 2 ==1) result=(result * base)%M; base=(base*base)%M; exp=exp/2; } return result; }
ll modInverse(ll A,ll M = MOD) { return fast_pow(A,M-2,M); } // only when M is prime
ll n;
ll bfs(vector<vector<ll> > &adj, ll src) {
	priority_queue<pair<ll,ll> > q;
	vector<ll> vis(n, 0);
	q.push({1,src});
	vis[src] = 1;
	ll largest = INT_MIN;
	while(!q.empty()) {
		pair<ll,ll> p = q.top();
		ll node = p.second;
		largest = max(vis[node],largest);
		q.pop();
		for(ll nbr : adj[node]) {
			if(vis[nbr] < vis[node] + 1) {
				vis[nbr] = vis[node] + 1;
				q.push({vis[nbr], nbr});
			}
		}
	}
	return largest;
}
int main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
    ll k;
    cin >> n >> k;
    MK2DV(mat,k,n,0);
    vector<map<ll,ll> > mp(k);
    fer(i,0,k-1) {
    	fer(j,0,n-1) {
    		cin >> mat[i][j];
    		mp[i][mat[i][j]] = j;
    	}
    }
    vector<vector<ll> > adj(n);
    fer(i,0,n-2) {
    	fer(j,i+1,n-1) {
    		bool insert = true;
    		// mat[0][j] mat[0][
    		fer(col,0,k-1) {
    			if(mp[col][mat[0][j]] < mp[col][mat[0][i]]) {
    				insert = false;
    				break;
    			}
    		}
    		if(insert) {
    			adj[mat[0][i]-1].push_back(mat[0][j]-1);
    		}
    	}
    }
    ll finans = INT_MIN;
    fer(i,0,n-1) {
    	finans = max(finans,bfs(adj,i));
    }
    cout << finans;
    // fer(i,0,n-1) {
    // 	cout << i << "-->";
    // 	for(auto j : adj[i])
    // 		cout << j << " ";
    // 	cout << endl;
    // }
    return 0;
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author ssaxena36 FI/O from @uwi
 */
import java.io.*;
import java.util.*;
public class TesttClass
{
   static ArrayList<Integer>list=new ArrayList<>();
   void solution()
    {
        //TesttClass oj=new TesttClass();
    //   oj.SieveOfEratosthenes(101000);
        // System.out.print(list);
        int n=inpi();
        int b=inpi();
        int d=inpi();
        long sum=0; int count=0;
        for(int i=0;i<n;i++)
        {
            int x=inpi();
            if((x<=b))
            {
                sum+=x;
            if(sum>d)
            {
                count+=1;
                sum=0;
            }
            }
        }
        out.println(count);
    }
   public long sum(ArrayList<Long> arr)
   { long s=0;
       for(int i=0;i<arr.size();i++)
       {
           s+=arr.get(i);
       }
       return s;
   }
   public void SieveOfEratosthenes(int n)
{
    boolean prime[]=new boolean[n+1];
    Arrays.fill(prime, true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*2; i<=n; i += p)
                prime[i] = false;
        }
    }
    // Print all prime numbers
    for (int p=2; p<=n; p++)
    { if (prime[p])
    {
      //  System.out.print(p+" ");
        list.add(p);
    }
}
   // return list;
}

    InputStream obj;
    PrintWriter out;
    String check="";
    public static void main(String[] args)throws IOException{
        new TesttClass().main1();
    }
    void main1()throws IOException{
        out=new PrintWriter(System.out);
        obj=check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
       solution();
        out.flush();
        out.close();
    }
    byte inbuffer[]=new byte[1024];
    int lenbuffer=0,ptrbuffer=0;
    int readByte(){
        if(lenbuffer==-1)
            throw new InputMismatchException();
        if(ptrbuffer>=lenbuffer)
        {
            ptrbuffer=0;
            try {
                lenbuffer=obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if(lenbuffer<=0)
            return -1;
        return inbuffer[ptrbuffer++];
    }
    boolean isSpaceChar(int c)
    {
        return (!(c>=33 && c<=126));
    }
    int skip()
    {
        int b;
        while((b=readByte())!=-1 && isSpaceChar(b));
        return b;
    }
    String inps()
    {
        int b=skip();
        StringBuilder sb=new StringBuilder();
        while(!(isSpaceChar(b)))
        {
            sb.appendCodePoint(b);
            b=readByte();
        }
        return sb.toString();
    }
    int inpi()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    long inpl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    float inpf()
    {
        return Float.parseFloat(inps());
    }
    double inpd()
    {
        return Double.parseDouble(inps());
    }
    char inpc()
    {
        return (char)skip();
    }
    int[] inpia(int n)
    {
        int a[]=new int[n];
        for(int i=0;i<n;i++)
            a[i]=inpi();
        return a;
    }
    long[] inpla(int n)
    {
        long a[]=new long[n];
        for(int i=0;i<n;i++)
            a[i]=inpl();
        return a;
    }
    String[] inpsa(int n)
    {
        String a[]=new String[n];
        for(int i=0;i<n;i++)
            a[i]=inps();
        return a;
    }
    double[][] inpdm(int n, int m)
    {
        double a[][]=new double[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpd();
        return a;
    }
    int[][] inpim(int n, int m)
    {
        int a[][]=new int[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpi();
        return a;
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author ssaxena36 FI/O from @uwi
 */
import java.io.*;
import java.util.*;
public class TesttClass
{
   static ArrayList<Integer>list=new ArrayList<>();
   void solution()
    {
        //TesttClass oj=new TesttClass();
    //   oj.SieveOfEratosthenes(101000);
        // System.out.print(list);
        int n=inpi();
        int b=inpi();
        int d=inpi();
        long sum=0;
        for(int i=0;i<n;i++)
        {
            int x=inpi();
            if(!(x>b))
            {
                sum+=x;
            }
        }
        if(sum<=d)
        {
            out.println("0");
        }
        else
        {
            out.println(sum/d);
        }
    }
   public long sum(ArrayList<Long> arr)
   { long s=0;
       for(int i=0;i<arr.size();i++)
       {
           s+=arr.get(i);
       }
       return s;
   }
   public void SieveOfEratosthenes(int n)
{
    boolean prime[]=new boolean[n+1];
    Arrays.fill(prime, true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*2; i<=n; i += p)
                prime[i] = false;
        }
    }
    // Print all prime numbers
    for (int p=2; p<=n; p++)
    { if (prime[p])
    {
      //  System.out.print(p+" ");
        list.add(p);
    }
}
   // return list;
}

    InputStream obj;
    PrintWriter out;
    String check="";
    public static void main(String[] args)throws IOException{
        new TesttClass().main1();
    }
    void main1()throws IOException{
        out=new PrintWriter(System.out);
        obj=check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
       solution();
        out.flush();
        out.close();
    }
    byte inbuffer[]=new byte[1024];
    int lenbuffer=0,ptrbuffer=0;
    int readByte(){
        if(lenbuffer==-1)
            throw new InputMismatchException();
        if(ptrbuffer>=lenbuffer)
        {
            ptrbuffer=0;
            try {
                lenbuffer=obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if(lenbuffer<=0)
            return -1;
        return inbuffer[ptrbuffer++];
    }
    boolean isSpaceChar(int c)
    {
        return (!(c>=33 && c<=126));
    }
    int skip()
    {
        int b;
        while((b=readByte())!=-1 && isSpaceChar(b));
        return b;
    }
    String inps()
    {
        int b=skip();
        StringBuilder sb=new StringBuilder();
        while(!(isSpaceChar(b)))
        {
            sb.appendCodePoint(b);
            b=readByte();
        }
        return sb.toString();
    }
    int inpi()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    long inpl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    float inpf()
    {
        return Float.parseFloat(inps());
    }
    double inpd()
    {
        return Double.parseDouble(inps());
    }
    char inpc()
    {
        return (char)skip();
    }
    int[] inpia(int n)
    {
        int a[]=new int[n];
        for(int i=0;i<n;i++)
            a[i]=inpi();
        return a;
    }
    long[] inpla(int n)
    {
        long a[]=new long[n];
        for(int i=0;i<n;i++)
            a[i]=inpl();
        return a;
    }
    String[] inpsa(int n)
    {
        String a[]=new String[n];
        for(int i=0;i<n;i++)
            a[i]=inps();
        return a;
    }
    double[][] inpdm(int n, int m)
    {
        double a[][]=new double[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpd();
        return a;
    }
    int[][] inpim(int n, int m)
    {
        int a[][]=new int[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpi();
        return a;
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author ssaxena36 FI/O from @uwi
 */
import java.io.*;
import java.util.*;
public class TesttClass
{
   static ArrayList<Integer>list=new ArrayList<>();
   void solution()
    {
        //TesttClass oj=new TesttClass();
    //   oj.SieveOfEratosthenes(101000);
        // System.out.print(list);
        int n=inpi();
        int b=inpi();
        int d=inpi();
        long sum=0; int count=0;
        for(int i=0;i<n;i++)
        {
            int x=inpi();
            if(!(x>b))
            {
                sum+=x;
            }
            if(sum>d)
            {
                count+=sum/d;
                sum=0;
            }
        }
        out.println(count);
    }
   public long sum(ArrayList<Long> arr)
   { long s=0;
       for(int i=0;i<arr.size();i++)
       {
           s+=arr.get(i);
       }
       return s;
   }
   public void SieveOfEratosthenes(int n)
{
    boolean prime[]=new boolean[n+1];
    Arrays.fill(prime, true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*2; i<=n; i += p)
                prime[i] = false;
        }
    }
    // Print all prime numbers
    for (int p=2; p<=n; p++)
    { if (prime[p])
    {
      //  System.out.print(p+" ");
        list.add(p);
    }
}
   // return list;
}

    InputStream obj;
    PrintWriter out;
    String check="";
    public static void main(String[] args)throws IOException{
        new TesttClass().main1();
    }
    void main1()throws IOException{
        out=new PrintWriter(System.out);
        obj=check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
       solution();
        out.flush();
        out.close();
    }
    byte inbuffer[]=new byte[1024];
    int lenbuffer=0,ptrbuffer=0;
    int readByte(){
        if(lenbuffer==-1)
            throw new InputMismatchException();
        if(ptrbuffer>=lenbuffer)
        {
            ptrbuffer=0;
            try {
                lenbuffer=obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if(lenbuffer<=0)
            return -1;
        return inbuffer[ptrbuffer++];
    }
    boolean isSpaceChar(int c)
    {
        return (!(c>=33 && c<=126));
    }
    int skip()
    {
        int b;
        while((b=readByte())!=-1 && isSpaceChar(b));
        return b;
    }
    String inps()
    {
        int b=skip();
        StringBuilder sb=new StringBuilder();
        while(!(isSpaceChar(b)))
        {
            sb.appendCodePoint(b);
            b=readByte();
        }
        return sb.toString();
    }
    int inpi()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    long inpl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    float inpf()
    {
        return Float.parseFloat(inps());
    }
    double inpd()
    {
        return Double.parseDouble(inps());
    }
    char inpc()
    {
        return (char)skip();
    }
    int[] inpia(int n)
    {
        int a[]=new int[n];
        for(int i=0;i<n;i++)
            a[i]=inpi();
        return a;
    }
    long[] inpla(int n)
    {
        long a[]=new long[n];
        for(int i=0;i<n;i++)
            a[i]=inpl();
        return a;
    }
    String[] inpsa(int n)
    {
        String a[]=new String[n];
        for(int i=0;i<n;i++)
            a[i]=inps();
        return a;
    }
    double[][] inpdm(int n, int m)
    {
        double a[][]=new double[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpd();
        return a;
    }
    int[][] inpim(int n, int m)
    {
        int a[][]=new int[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpi();
        return a;
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author ssaxena36 FI/O from @uwi
 */
import java.io.*;
import java.util.*;
public class TesttClass
{
   static ArrayList<Integer>list=new ArrayList<>();
   void solution()
    {
        //TesttClass oj=new TesttClass();
    //   oj.SieveOfEratosthenes(101000);
        // System.out.print(list);
        int n=inpi();
        int b=inpi();
        int d=inpi();
        long sum=0; int count=0;
        for(int i=0;i<n;i++)
        {
            int x=inpi();
            if((x<=b))
            {
                sum+=x;
            if(sum>d)
            {
                count+=sum/d;
                sum=0;
            }
            }
        }
        out.println(count);
    }
   public long sum(ArrayList<Long> arr)
   { long s=0;
       for(int i=0;i<arr.size();i++)
       {
           s+=arr.get(i);
       }
       return s;
   }
   public void SieveOfEratosthenes(int n)
{
    boolean prime[]=new boolean[n+1];
    Arrays.fill(prime, true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*2; i<=n; i += p)
                prime[i] = false;
        }
    }
    // Print all prime numbers
    for (int p=2; p<=n; p++)
    { if (prime[p])
    {
      //  System.out.print(p+" ");
        list.add(p);
    }
}
   // return list;
}

    InputStream obj;
    PrintWriter out;
    String check="";
    public static void main(String[] args)throws IOException{
        new TesttClass().main1();
    }
    void main1()throws IOException{
        out=new PrintWriter(System.out);
        obj=check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
       solution();
        out.flush();
        out.close();
    }
    byte inbuffer[]=new byte[1024];
    int lenbuffer=0,ptrbuffer=0;
    int readByte(){
        if(lenbuffer==-1)
            throw new InputMismatchException();
        if(ptrbuffer>=lenbuffer)
        {
            ptrbuffer=0;
            try {
                lenbuffer=obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if(lenbuffer<=0)
            return -1;
        return inbuffer[ptrbuffer++];
    }
    boolean isSpaceChar(int c)
    {
        return (!(c>=33 && c<=126));
    }
    int skip()
    {
        int b;
        while((b=readByte())!=-1 && isSpaceChar(b));
        return b;
    }
    String inps()
    {
        int b=skip();
        StringBuilder sb=new StringBuilder();
        while(!(isSpaceChar(b)))
        {
            sb.appendCodePoint(b);
            b=readByte();
        }
        return sb.toString();
    }
    int inpi()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    long inpl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    float inpf()
    {
        return Float.parseFloat(inps());
    }
    double inpd()
    {
        return Double.parseDouble(inps());
    }
    char inpc()
    {
        return (char)skip();
    }
    int[] inpia(int n)
    {
        int a[]=new int[n];
        for(int i=0;i<n;i++)
            a[i]=inpi();
        return a;
    }
    long[] inpla(int n)
    {
        long a[]=new long[n];
        for(int i=0;i<n;i++)
            a[i]=inpl();
        return a;
    }
    String[] inpsa(int n)
    {
        String a[]=new String[n];
        for(int i=0;i<n;i++)
            a[i]=inps();
        return a;
    }
    double[][] inpdm(int n, int m)
    {
        double a[][]=new double[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpd();
        return a;
    }
    int[][] inpim(int n, int m)
    {
        int a[][]=new int[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpi();
        return a;
    }
}


*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author ssaxena36 FI/O from @uwi
 */
import java.io.*;
import java.util.*;
public class TesttClass
{
   static ArrayList<Integer>list=new ArrayList<>();
   void solution()
    {
        //TesttClass oj=new TesttClass();
    //   oj.SieveOfEratosthenes(101000);
        // System.out.print(list);
        int n=inpi();
        int b=inpi();
        int d=inpi();
        long sum=0; int count=0;
        for(int i=0;i<n;i++)
        {
            int x=inpi();
            if(!(x>b))
            {
                sum+=x;
            }
            if(sum>d)
            {
                count+=sum/d;
                sum=sum%d;
            }
        }
        out.println(count);
    }
   public long sum(ArrayList<Long> arr)
   { long s=0;
       for(int i=0;i<arr.size();i++)
       {
           s+=arr.get(i);
       }
       return s;
   }
   public void SieveOfEratosthenes(int n)
{
    boolean prime[]=new boolean[n+1];
    Arrays.fill(prime, true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*2; i<=n; i += p)
                prime[i] = false;
        }
    }
    // Print all prime numbers
    for (int p=2; p<=n; p++)
    { if (prime[p])
    {
      //  System.out.print(p+" ");
        list.add(p);
    }
}
   // return list;
}

    InputStream obj;
    PrintWriter out;
    String check="";
    public static void main(String[] args)throws IOException{
        new TesttClass().main1();
    }
    void main1()throws IOException{
        out=new PrintWriter(System.out);
        obj=check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
       solution();
        out.flush();
        out.close();
    }
    byte inbuffer[]=new byte[1024];
    int lenbuffer=0,ptrbuffer=0;
    int readByte(){
        if(lenbuffer==-1)
            throw new InputMismatchException();
        if(ptrbuffer>=lenbuffer)
        {
            ptrbuffer=0;
            try {
                lenbuffer=obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if(lenbuffer<=0)
            return -1;
        return inbuffer[ptrbuffer++];
    }
    boolean isSpaceChar(int c)
    {
        return (!(c>=33 && c<=126));
    }
    int skip()
    {
        int b;
        while((b=readByte())!=-1 && isSpaceChar(b));
        return b;
    }
    String inps()
    {
        int b=skip();
        StringBuilder sb=new StringBuilder();
        while(!(isSpaceChar(b)))
        {
            sb.appendCodePoint(b);
            b=readByte();
        }
        return sb.toString();
    }
    int inpi()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    long inpl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    float inpf()
    {
        return Float.parseFloat(inps());
    }
    double inpd()
    {
        return Double.parseDouble(inps());
    }
    char inpc()
    {
        return (char)skip();
    }
    int[] inpia(int n)
    {
        int a[]=new int[n];
        for(int i=0;i<n;i++)
            a[i]=inpi();
        return a;
    }
    long[] inpla(int n)
    {
        long a[]=new long[n];
        for(int i=0;i<n;i++)
            a[i]=inpl();
        return a;
    }
    String[] inpsa(int n)
    {
        String a[]=new String[n];
        for(int i=0;i<n;i++)
            a[i]=inps();
        return a;
    }
    double[][] inpdm(int n, int m)
    {
        double a[][]=new double[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpd();
        return a;
    }
    int[][] inpim(int n, int m)
    {
        int a[][]=new int[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpi();
        return a;
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author ssaxena36 FI/O from @uwi
 */
import java.io.*;
import java.util.*;
public class TesttClass
{
   static ArrayList<Integer>list=new ArrayList<>();
   void solution()
    {
        //TesttClass oj=new TesttClass();
    //   oj.SieveOfEratosthenes(101000);
        // System.out.print(list);
        int n=inpi();
        int b=inpi();
        int d=inpi();
        long sum=0; int count=0;
        for(int i=0;i<n;i++)
        {
            int x=inpi();
            if((x<=b))
            {
                sum+=x;
            }
            if(sum>d)
            {
                count+=sum/d;
                sum=0;
            }
        }
        out.println(count);
    }
   public long sum(ArrayList<Long> arr)
   { long s=0;
       for(int i=0;i<arr.size();i++)
       {
           s+=arr.get(i);
       }
       return s;
   }
   public void SieveOfEratosthenes(int n)
{
    boolean prime[]=new boolean[n+1];
    Arrays.fill(prime, true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*2; i<=n; i += p)
                prime[i] = false;
        }
    }
    // Print all prime numbers
    for (int p=2; p<=n; p++)
    { if (prime[p])
    {
      //  System.out.print(p+" ");
        list.add(p);
    }
}
   // return list;
}

    InputStream obj;
    PrintWriter out;
    String check="";
    public static void main(String[] args)throws IOException{
        new TesttClass().main1();
    }
    void main1()throws IOException{
        out=new PrintWriter(System.out);
        obj=check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
       solution();
        out.flush();
        out.close();
    }
    byte inbuffer[]=new byte[1024];
    int lenbuffer=0,ptrbuffer=0;
    int readByte(){
        if(lenbuffer==-1)
            throw new InputMismatchException();
        if(ptrbuffer>=lenbuffer)
        {
            ptrbuffer=0;
            try {
                lenbuffer=obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if(lenbuffer<=0)
            return -1;
        return inbuffer[ptrbuffer++];
    }
    boolean isSpaceChar(int c)
    {
        return (!(c>=33 && c<=126));
    }
    int skip()
    {
        int b;
        while((b=readByte())!=-1 && isSpaceChar(b));
        return b;
    }
    String inps()
    {
        int b=skip();
        StringBuilder sb=new StringBuilder();
        while(!(isSpaceChar(b)))
        {
            sb.appendCodePoint(b);
            b=readByte();
        }
        return sb.toString();
    }
    int inpi()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    long inpl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-')
        {
            minus = true;
            b = readByte();
        }
        while(true)
        {
            if(b >= '0' && b <= '9')
            {
                num = num * 10 + (b - '0');
            }
            else
            {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    float inpf()
    {
        return Float.parseFloat(inps());
    }
    double inpd()
    {
        return Double.parseDouble(inps());
    }
    char inpc()
    {
        return (char)skip();
    }
    int[] inpia(int n)
    {
        int a[]=new int[n];
        for(int i=0;i<n;i++)
            a[i]=inpi();
        return a;
    }
    long[] inpla(int n)
    {
        long a[]=new long[n];
        for(int i=0;i<n;i++)
            a[i]=inpl();
        return a;
    }
    String[] inpsa(int n)
    {
        String a[]=new String[n];
        for(int i=0;i<n;i++)
            a[i]=inps();
        return a;
    }
    double[][] inpdm(int n, int m)
    {
        double a[][]=new double[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpd();
        return a;
    }
    int[][] inpim(int n, int m)
    {
        int a[][]=new int[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                a[i][j]=inpi();
        return a;
    }
}


import java.util.Scanner;

public class Testing {

    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;

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

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

    }

}


import java.util.Scanner;

public class Testing {

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

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

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

    }

}


import java.util.Scanner;

public class Testing {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int b = sc.nextInt();
        int d = sc.nextInt();
        long sum = 0;
        int count = 0;
        for (int i = 0; i < n; i++) {
            int k = sc.nextInt();
            if (k <= b) {
                sum += k;
                if (sum > d) {
                    sum = 0;
                    count++;
                }
            }

        }
        System.out.println(count);

    }

}


import java.util.Scanner;

public class Testing {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int b = sc.nextInt();
        int d = sc.nextInt();
        long sum = 0;
        int count = 0;
        for (int i = 0; i < n; i++) {
            int k = sc.nextInt();
            if (k < b) {
                sum += k;
                if (sum >= d) {
                    sum = 0;
                    count++;
                }
            }

        }
        System.out.println(count);

    }

}


import java.util.Scanner;

public class Testing {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int b = sc.nextInt();
        int d = sc.nextInt();
        long sum = 0;
        int count = 0;
        for (int i = 0; i < n; i++) {
            int k = sc.nextInt();
            if (k < b) {
                sum += k;
                if (sum > d) {
                    sum = 0;
                    count++;
                }
            }

        }
        System.out.println(count);

    }

}


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 *
 */
public class TaskA {
    public static void main(String[] args) {
        InputStream inputStream;
        String str = null;
        if(str == null){
            inputStream = System.in;
        }else{
            inputStream = new ByteArrayInputStream(str.getBytes());
        }

        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(1, in, out);
        out.close();
    }

    static class Solver {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int numOranges = in.nextInt();
            int maxJuice = in.nextInt();
            int overflow = in.nextInt();

            int currentFlow = 0;
            int count = 0;
            for(int i=0;i<numOranges;i++){
                int orangeSize = in.nextInt();
                if(orangeSize <= maxJuice){
                    currentFlow += orangeSize;
                }

                if(currentFlow >= overflow){
                    count++;
                    currentFlow = 0;
                }
            }
            System.out.println(count);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 *
 */
public class TaskA {
    public static void main(String[] args) {
        InputStream inputStream;
        String str = null;
        if(str == null){
            inputStream = System.in;
        }else{
            inputStream = new ByteArrayInputStream(str.getBytes());
        }

        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(1, in, out);
        out.close();
    }

    static class Solver {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int numOranges = in.nextInt();
            int maxJuice = in.nextInt();
            int overflow = in.nextInt();

            int currentFlow = 0;
            int count = 0;
            for(int i=0;i<numOranges;i++){
                int orangeSize = in.nextInt();
                if(orangeSize <= maxJuice){
                    currentFlow += orangeSize;
                }

                if(currentFlow >= maxJuice){
                    int extraFlow = currentFlow - maxJuice;
                    if(extraFlow >= overflow){
                        count++;

                    }
                    extraFlow = 0;
                    currentFlow = 0;
                }

            }
            System.out.println(count);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 *
 */
public class TaskA {
    public static void main(String[] args) {
        InputStream inputStream;
        String str = null;
        if(str == null){
            inputStream = System.in;
        }else{
            inputStream = new ByteArrayInputStream(str.getBytes());
        }

        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(1, in, out);
        out.close();
    }

    static class Solver {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int numOranges = in.nextInt();
            int maxJuice = in.nextInt();
            int overflow = in.nextInt();

            int currentFlow = 0;
            int count = 0;
            for(int i=0;i<numOranges;i++){
                int orangeSize = in.nextInt();
                if(orangeSize <= maxJuice){
                    currentFlow += orangeSize;
                }

                if(currentFlow > overflow){
                    count++;
                    currentFlow = 0;
                }

            }
            System.out.println(count);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 *
 */
public class TaskA {
    public static void main(String[] args) {
        InputStream inputStream;
        String str = null;
        if(str == null){
            inputStream = System.in;
        }else{
            inputStream = new ByteArrayInputStream(str.getBytes());
        }

        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(1, in, out);
        out.close();
    }

    static class Solver {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int numOranges = in.nextInt();
            int maxJuice = in.nextInt();
            int overflow = in.nextInt();

            int currentFlow = 0;
            int count = 0;
            for(int i=0;i<numOranges;i++){
                int orangeSize = in.nextInt();
                if(orangeSize <= maxJuice){
                    currentFlow += orangeSize;
                }

                if(currentFlow >= maxJuice){
                    int extraFlow = currentFlow - maxJuice;
                    if(currentFlow >= overflow){
                        count++;

                    }
                    extraFlow = 0;
                    currentFlow = 0;
                }

            }
            System.out.println(count);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 *
 */
public class TaskA {
    public static void main(String[] args) {
        InputStream inputStream;
        String str = null;
        if(str == null){
            inputStream = System.in;
        }else{
            inputStream = new ByteArrayInputStream(str.getBytes());
        }

        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(1, in, out);
        out.close();
    }

    static class Solver {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int numOranges = in.nextInt();
            int maxJuice = in.nextInt();
            int overflow = in.nextInt();

            int currentFlow = 0;
            int count = 0;
            for(int i=0;i<numOranges;i++){
                int orangeSize = in.nextInt();
                if(orangeSize <= maxJuice){
                    currentFlow += orangeSize;
                }

                if(currentFlow >= overflow){
                    count++;
                    currentFlow = 0;
                }

            }
            System.out.println(count);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 *
 */
public class TaskA {
    public static void main(String[] args) {
        InputStream inputStream;
        String str = null;
        if(str == null){
            inputStream = System.in;
        }else{
            inputStream = new ByteArrayInputStream(str.getBytes());
        }

        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(1, in, out);
        out.close();
    }

    static class Solver {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int numOranges = in.nextInt();
            int maxJuice = in.nextInt();
            int overflow = in.nextInt();

            int currentFlow = 0;
            int count = 0;
            for(int i=0;i<numOranges;i++){
                int orangeSize = in.nextInt();
                if(orangeSize <= maxJuice){
                    currentFlow += orangeSize;
                }

                if(currentFlow >= maxJuice){
                    if(currentFlow > overflow){
                        count++;
                    }
                    currentFlow = 0;
                }

            }
            System.out.println(count);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 *
 */
public class TaskA {
    public static void main(String[] args) {
        InputStream inputStream;
        String str = null;
        if(str == null){
            inputStream = System.in;
        }else{
            inputStream = new ByteArrayInputStream(str.getBytes());
        }

        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(1, in, out);
        out.close();
    }

    static class Solver {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int numOranges = in.nextInt();
            int maxJuice = in.nextInt();
            int overflow = in.nextInt();

            int currentFlow = 0;
            int count = 0;
            for(int i=0;i<numOranges;i++){
                int orangeSize = in.nextInt();
                if(orangeSize <= maxJuice){
                    currentFlow += orangeSize;
                }

                if(currentFlow >= maxJuice){
                    if(currentFlow > overflow){
                        count++;
                    }
                    currentFlow -= maxJuice;
                }

            }
            System.out.println(count);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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


    import java.util.*;
    import java.lang.*;
    public class games
    {
        public static void main(String args[])
        {

Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
long b=sc.nextLong();
long d=sc.nextLong();
int count=0,c=0;
while(t-->0)
{
int a=sc.nextInt();
if(a<=(int)b)
count+=a;
else
break;
if(count>(int)d)
{c++;
count=0;

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


    import java.util.*;
    import java.lang.*;
    public class games
    {
        public static void main(String args[])
        {

Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
long b=sc.nextLong();
long d=sc.nextLong();
int count=0,c=0;
while(t-->0)
{
int a=sc.nextInt();
if(a<=(int)b)
count+=a;

if(count>(int)d)
{c++;
count=0;

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


    import java.util.*;
    import java.lang.*;
    public class games
    {
        public static void main(String args[])
        {

Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
long b=sc.nextLong();
long d=sc.nextLong();
int count=0,c=0;
while(t-->0)
{
int a=sc.nextInt();
if(a<=(int)b)
count+=a;
else
break;
if(count>(int)d)
{c++;
count-=(int)d;

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


    import java.util.*;
    import java.lang.*;
    public class games
    {
        public static void main(String args[])
        {

Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
int b=sc.nextInt();
int d=sc.nextInt();
int count=0,c=0;
while(t-->0)
{
int a=sc.nextInt();
if(a<=b)
count+=a;
else
c=0;
if(count>d)
{c++;
count-=d;

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


    import java.util.*;
    import java.lang.*;
    public class games
    {
        public static void main(String args[])
        {

Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
int b=sc.nextInt();
int d=sc.nextInt();
int count=0,c=0;
while(t-->0)
{
int a=sc.nextInt();
if(a<=b)
count+=a;
else
c=0;
if(count>=d)
{c++;
count-=d;

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


    import java.util.*;
    import java.lang.*;
    public class games
    {
        public static void main(String args[])
        {

Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
int b=sc.nextInt();
int d=sc.nextInt();
int count=0,c=0;
while(t-->0)
{
int a=sc.nextInt();
if(a<=b)
count+=a;
else
break;
if(count>d)
{c++;
count-=d;

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


import java.util.Scanner;
public class orange {
    public static void main(String[] args) {
        Scanner cs= new Scanner(System.in);
        int n= cs.nextInt();
        int ms= cs.nextInt();
        int mw= cs.nextInt();
        int[] s= new int[n];
        for(int i=0;i<n;i++){
            s[i]= cs.nextInt();
        }

        int i=0;
        int w=0;
        int times=0;
        while(n>0){
            if(s[i]<=ms){
                w+=s[i];

            while(w>mw){
                w-=mw;
                times++;
            }
            n--;
            i++;
        }}

        System.out.print(times);
    }
}


import java.util.Scanner;
public class orange {
    public static void main(String[] args) {
        Scanner cs= new Scanner(System.in);
        int n= cs.nextInt();
        int ms= cs.nextInt();
        int mw= cs.nextInt();
        int[] s= new int[n];
        for(int i=0;i<n;i++){
            s[i]= cs.nextInt();
        }

        int i=0;
        int w=0;
        int times=0;
        while(n>0){
            if(s[i]<=ms){
                w+=s[i];
            }
            while(w>mw && s[i]<=ms){//the added stuff
                w-=mw;
                times++;
            }
            n--;
            i++;
        }

        System.out.print(times);
    }
}


import java.util.Scanner;
public class orange {
    public static void main(String[] args) {
        Scanner cs= new Scanner(System.in);
        int n= cs.nextInt();
        int ms= cs.nextInt();
        int mw= cs.nextInt();
        int[] s= new int[n];
        for(int i=0;i<n;i++){
            s[i]= cs.nextInt();
        }

        int i=0;
        int w=0;
        int times=0;
        while(n>0){
            if(s[i]<=ms){
                w+=s[i];
            }
            if(w>mw){
                w-=mw;
                times++;
            }
            n--;
            i++;
        }

        System.out.print(times);
    }
}


import java.util.Scanner;
public class orange {
    public static void main(String[] args) {
        Scanner cs= new Scanner(System.in);
        int n= cs.nextInt();
        int ms= cs.nextInt();
        int mw= cs.nextInt();
        int[] s= new int[n];
        for(int i=0;i<n;i++){
            s[i]= cs.nextInt();
        }

        int i=0;
        int w=0;
        int times=0;
        while(n>0){
            if(s[i]<=ms){
                w+=s[i];
            }
            if(w>mw){
                w=0;//w-=mw;
                times++;
            }
            n--;
            i++;
        }

        System.out.print(times);
    }
}


import java.util.Scanner;
public class orange {
    public static void main(String[] args) {
        Scanner cs= new Scanner(System.in);
        int n= cs.nextInt();
        int ms= cs.nextInt();
        int mw= cs.nextInt();
        int[] s= new int[n];
        for(int i=0;i<n;i++){
            s[i]= cs.nextInt();
        }

        int i=0;
        int w=0;
        int times=0;
        while(n>0){
            if(s[i]<=ms){
                w+=s[i];
            }
            while(w>mw){
                w-=mw;
                times++;
            }
            n--;
            i++;
        }

        System.out.print(times);
    }
}


import java.util.Scanner;
public class orange {
    public static void main(String[] args) {
        Scanner cs= new Scanner(System.in);
        int n= cs.nextInt();
        int ms= cs.nextInt();
        int mw= cs.nextInt();
        int[] s= new int[n];
        for(int i=0;i<n;i++){
            s[i]= cs.nextInt();
        }

        int i=0;
        int w=0;
        int times=0;
        while(n>0){
            if(s[i]<=ms){
                w+=s[i];

            if(w>mw){
                w-=mw;
                times++;
            }
            n--;
            i++;
        }}

        System.out.print(times);
    }
}


import java.util.Scanner;

public class Sheet3{

    public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
 int n,b ;
         long  d ,count=0;
 n=input.nextInt();
 b=input.nextInt();
 d=input.nextInt();
int imp =0 ;
 int []Array=new int[n];
 for(int i = 0 ; i<Array.length ; i ++){
 Array[i]= input.nextInt();
 if(Array[i]>b) continue;
 else count+=Array[i];
 if (count>d){
     count=0;
     imp++;
 }
 }
        System.out.println(imp);

}
      }


import java.util.Scanner;

public class Sheet3{

    public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
 int n,b ;
         long  d ,count=0;
 n=input.nextInt();
 b=input.nextInt();
 d=input.nextInt();
int imp =0 ;
 int []Array=new int[n];
 for(int i = 0 ; i<Array.length ; i ++){
 Array[i]= input.nextInt();
 if(Array[i]>=b) continue;
 else count+=Array[i];
 if (count>=d) imp++;
 }
        System.out.println(imp);

}
      }


import java.util.Scanner;

public class Sheet3{

    public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
 int n,b ;
         long  d ,count=0;
 n=input.nextInt();
 b=input.nextInt();
 d=input.nextInt();

 int []Array=new int[n];
 for(int i = 0 ; i<Array.length ; i ++){
 Array[i]= input.nextInt();
 if(Array[i]>=b) continue;
 else count+=Array[i];
 }
        System.out.println(count/d);

}
      }


import java.util.Scanner;

public class Sheet3{

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

 int []Array=new int[n];
 for(int i = 0 ; i<Array.length ; i ++){
 Array[i]= input.nextInt();
 if(Array[i]>=b) continue;
 else count+=Array[i];
 }
        System.out.println(count/d);

}
      }


import java.util.Scanner;

public class Sheet3{

    public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
 int n,b ;
         long  d ,count=0;
 n=input.nextInt();
 b=input.nextInt();
 d=input.nextInt();
int imp =0 ;
 int []Array=new int[n];
 for(int i = 0 ; i<Array.length ; i ++){
 Array[i]= input.nextInt();
 if(Array[i]>=b) continue;
 else count+=Array[i];
 if (count>=d){
     count=0;
     imp++;
 }
 }
        System.out.println(imp);

}
      }


import java.util.Scanner;

public class Sheet3{

    public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
 int n,b,d ;
         long count=0;
 n=input.nextInt();
 b=input.nextInt();
 d=input.nextInt();

 int []Array=new int[n];
 for(int i = 0 ; i<Array.length ; i ++){
 Array[i]= input.nextInt();
 if(Array[i]<=b) continue;
 else count+=Array[i];
 }
        System.out.println(count/d);

}
      }


import java.util.Scanner ;

/**
 *
 * @author Mohammed_emad
 */
public class Juicer {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int n,size,count=0,waste = 0 ,temp ,temWaste=0 ;;
        Scanner input = new Scanner (System.in) ;
        n = input.nextInt() ;
        size = input.nextInt() ;
        waste = input.nextInt() ;
        for (int i = 0;i<n;i++)
        {
            //int temp ,temWaste=0 ;
            temp = input.nextInt() ;
            if (temp >= size)
            {
                continue ;
            }
            else
            {
               temWaste +=temp ;
            }

            if (temWaste >= waste)
            {
                temWaste = 0 ;
                count+=1;
            }
        }
        System.out.println(count);

    }

}


import java.util.Scanner ;

/**
 *
 * @author Mohammed_emad
 */
public class Juicer {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int n,size,count=0,waste ,temp ,temWaste=0 ;;
        Scanner input = new Scanner (System.in) ;
        n = input.nextInt() ;
        size = input.nextInt() ;
        waste = input.nextInt() ;
        for (int i = 0;i<n;i++)
        {
            //int temp ,temWaste=0 ;
            temp = input.nextInt() ;
            if (temp > size)
            {
                continue ;
            }
            else
            {
               temWaste +=temp ;
            }

            if (temWaste >= waste)
            {
                temWaste = 0 ;
                count+=1;
            }
        }
        System.out.println(count);

    }

}


import java.util.Scanner ;

/**
 *
 * @author Mohammed_emad
 */
public class Juicer {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int n,size,count=0,waste ,temp ,temWaste=0 ;;
        Scanner input = new Scanner (System.in) ;
        n = input.nextInt() ;
        size = input.nextInt() ;
        waste = input.nextInt() ;
        for (int i = 0;i<n;i++)
        {
            //int temp ,temWaste=0 ;
            temp = input.nextInt() ;
            if (temp >= size)
            {
                continue ;
            }
            else
            {
               temWaste +=temp ;
            }

            if (temWaste >= waste)
            {
                temWaste = 0 ;
                count+=1;
            }
        }
        System.out.println(count);

    }

}


import java.util.Scanner ;

/**
 *
 * @author Mohammed_emad
 */
public class Juicer02 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int n,b,d,count = 0 ,tempWaste = 0 ;
        Scanner in = new Scanner(System.in) ;
        n = in.nextInt() ;
        b = in.nextInt() ;
        d = in.nextInt() ;
        int [] arr  = new int [n] ;
        for (int i=0;i<n;i++)
        {

            arr[i] = in.nextInt()  ;
            if (arr[i] >= b)
                continue ;
            else
                tempWaste += arr[i] ;
            if (tempWaste > d)
            {
                tempWaste = 0 ;
                count++ ;
            }

        }
        System.out.println(count);
    }

}


import java.util.Scanner ;

/**
 *
 * @author Mohammed_emad
 */
public class Juicer02 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int n,b,d,count = 0 ,tempWaste = 0 ;
        Scanner in = new Scanner(System.in) ;
        n = in.nextInt() ;
        b = in.nextInt() ;
        d = in.nextInt() ;
        int [] arr  = new int [n] ;
        for (int i=0;i<n;i++)
        {

            arr[i] = in.nextInt()  ;
            if (arr[i] > b)
                continue ;
            else
                tempWaste += arr[i] ;
            if (tempWaste > d)
            {
                tempWaste = 0 ;
                count++ ;
            }

        }
        System.out.println(count);
    }

}


import java.util.Scanner ;

/**
 *
 * @author Mohammed_emad
 */
public class Juicer {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int n,size,count=0,waste = 0 ;
        Scanner input = new Scanner (System.in) ;
        n = input.nextInt() ;
        size = input.nextInt() ;
        waste = input.nextInt() ;
        for (int i = 0;i<n;i++)
        {
            int temp ,temWaste=0 ;
            temp = input.nextInt() ;
            if (temp >= size)
            {
                continue ;
            }
            else
            {
               temWaste +=temp ;
            }

            if (temWaste >= waste)
            {
                temWaste = 0 ;
                count+=1;
            }
        }
        System.out.println(count);

    }

}


import java.util.Scanner;

/**
 *
 * @author ahmed sabrey
 */
public class Juicer {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);

        int n,b,d,a,x=0,sum=0;

        n = in.nextInt();
        b = in.nextInt();
        d = in.nextInt();
         for (int i = 0; i < n; i++){
             a =in.nextInt();

             if(a<=b)
                 sum +=a;

             if (sum>d)
                 x++;

         }
         System.out.println(x);
    }

}


import java.util.Scanner;

/**
 *
 * @author ahmed sabrey
 */
public class JavaApplication37 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner input = new Scanner(System.in);
        int sum = 0;
        int b,d,n;

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

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

        sum+=a;

        }

       int x = Math.abs(b-(sum-1));

       if (b==sum) System.out.println(0);

       else System.out.println((d%x));
}
}


import java.util.Scanner;

/**
 *
 * @author ahmed sabrey
 */
public class JavaApplication37 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner input = new Scanner(System.in);
        int sum = 0;
        int b,d,n;

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

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

        sum+=a;

        }

       int x = Math.abs(b-sum);

       if (b==sum) System.out.println(0);

       else System.out.println(d%x);
}
}


import java.util.Scanner;

/**
 *
 * @author ahmed sabrey
 */
public class JavaApplication37 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
               int n= sc.nextInt();
        int b= sc.nextInt();
        int d= sc.nextInt();

        int count=0;
        int s =0;
        for(int i=0;i<n;i++){
            int a= sc.nextInt();
            if(a>b){
                continue;
            }else{
                count+=a;
                if(count>d){
                    s++;
                    count = 0;
                }
            }

        }

        System.out.println(s);
    }
}


import java.util.Scanner;

/**
 *
 * @author ahmed sabrey
 */
public class Juicer {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner in = new Scanner(System.in);

        int n,b,d,a,x=0,sum=0;

        n = in.nextInt();
        b = in.nextInt();
        d = in.nextInt();
         for (int i = 0; i < n; i++){
             a =in.nextInt();

             if(a<=b)
                 sum +=a;

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

}


import java.util.Scanner;

public class CodeForceMain {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int b = scanner.nextInt();
		int d = scanner.nextInt();
		int total = 0;
		int result = 0;
		for (int i=0; i<n; i++) {
			int orange = scanner.nextInt();
			if (orange <= b) {
				total += orange;
			}
			if (total > d) {
				result++;
				total = 0;
			}
		}
		System.out.println(result);
	}
}


import java.util.Scanner;

public class CodeForceMain {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int b = scanner.nextInt();
		int d = scanner.nextInt();
		int total = 0;
		for (int i=0; i<n; i++) {
			int orange = scanner.nextInt();
			if (orange <= b) {
				total += orange;
			}
		}
		System.out.println(total/d);
	}
}


import java.util.Scanner;

public class CodeForceMain {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int b = scanner.nextInt();
		int d = scanner.nextInt();
		int total = 0;
		int result = 0;
		for (int i=0; i<n; i++) {
			int orange = scanner.nextInt();
			if (orange <= b) {
				total += orange;
			}
			if (total >= d) {
				result++;
				total = 0;
			}
		}
		System.out.println(result);
	}
}


import java.util.Scanner;

public class CodeForceMain {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int b = scanner.nextInt();
		int d = scanner.nextInt();
		int total = 0;
		int result = 0;
		for (int i=0; i<n; i++) {
			int orange = scanner.nextInt();
			if (orange < b) {
				total += orange;
			}
			if (total > d) {
				result++;
				total = 0;
			}
		}
		System.out.println(result);
	}
}


import java.util.Scanner;

public class CodeForceMain {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int b = scanner.nextInt();
		int d = scanner.nextInt();
		long total = 0;
		for (int i=0; i<n; i++) {
			int orange = scanner.nextInt();
			if (orange < b) {
				total += orange;
			}
		}
		System.out.println(total/d);
	}
}


import java.util.Scanner;

public class CodeForceMain {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int b = scanner.nextInt();
		int d = scanner.nextInt();
		int total = 0;
		for (int i=0; i<n; i++) {
			int orange = scanner.nextInt();
			if (orange < b) {
				total += orange;
			}
		}
		System.out.println(total/d);
	}
}


import java.util.Scanner;
public class abdo  {
public static void main(String[] args){
Scanner abd = new Scanner(System.in);
      int n=abd.nextInt();
      int b=abd.nextInt();
      int c=abd.nextInt();
      int s=0,k=0;
      int []x=new int[n];
      for(int i=0;i<n;i++){
        x[i]=abd.nextInt();
      }
      for(int i=0;i<n;i++){
          if(x[i]<=b){
              s+=x[i];
              if(s>c){
                  k++;
                  s=0;
              }
          }
      }

         System.out.println(k);
}}


import java.util.Scanner;
public class abdo  {
public static void main(String[] args){
Scanner abd = new Scanner(System.in);
      int n=abd.nextInt();
      int b=abd.nextInt();
      int c=abd.nextInt();
      int s=0,k=0;
      int []x=new int[n];
      for(int i=0;i<n;i++){
        x[i]=abd.nextInt();
      }
      for(int i=0;i<n;i++){
          if(x[i]<=b&&x[i]<c){
              s+=x[i];
              if(s>c){
                  k++;
                  s=0;
              }
          }
      }

         System.out.println(k);
}}


import java.util.Scanner;
public class abdo  {
public static void main(String[] args){
Scanner abd = new Scanner(System.in);
      int n=abd.nextInt();
      int b=abd.nextInt();
      int c=abd.nextInt();
      int s=0,k=0;
      int []x=new int[n];
      for(int i=0;i<n;i++){
        x[i]=abd.nextInt();
      }
      for(int i=0;i<n;i++){
          if(x[i]>=c)
              continue;
          else{
              if(x[i]<=b){
                 s+=x[i];
                 if(s>c){
                    ++k;
                    s=0;
                 }
              }
          }
      }
         System.out.println(k);
}}


import java.util.Scanner;
public class abdo  {
public static void main(String[] args){
Scanner abd = new Scanner(System.in);
      int n=abd.nextInt();
      int b=abd.nextInt();
      int c=abd.nextInt();
      int s=0,k=0;
      int []x=new int[n];
      for(int i=0;i<n;i++){
        x[i]=abd.nextInt();
      }
      for(int i=0;i<n;i++){
          if(x[i]<=b&&x[i]<c){
              s+=x[i];
              if(s>=c){
                  k++;
                  s=0;
              }
          }
      }

         System.out.println(k);
}}


import java.util.Scanner;
public class abdo  {
public static void main(String[] args){
Scanner abd = new Scanner(System.in);
      int n=abd.nextInt();
      int b=abd.nextInt();
      int c=abd.nextInt();
      int s=0,k=0;
      int []x=new int[n];
      for(int i=0;i<n;i++){
        x[i]=abd.nextInt();
      }
      for(int i=0;i<n;i++){
          if(x[i]<=b&&x[i]<c){
              s++;
          }
      }
      if(s==n)
          System.out.println("1");
      else
         System.out.println("0");
}}


import java.util.Scanner;
public class abdo  {
public static void main(String[] args){
Scanner abd = new Scanner(System.in);
      int n=abd.nextInt();
      int b=abd.nextInt();
      int c=abd.nextInt();
      int s=0,k=0;
      int []x=new int[n];
      for(int i=0;i<n;i++){
        x[i]=abd.nextInt();
      }
      for(int i=0;i<n;i++){
          if(x[i]>=c)
              continue;
          else{
              if(x[i]<=b){
                 s+=x[i];
                 if(s>c){
                    k++;
                    s=0;
                 }
              }
          }
      }
         System.out.println(k);
}}


/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader readData=new BufferedReader(new InputStreamReader(System.in));
		String data[]=readData.readLine().split("\\s+");
		long numOranges=Integer.parseInt(data[0]);
		long sizeLimit=Integer.parseInt(data[1]);
		long wasteLimit=Integer.parseInt(data[2]);
		long sum=0,empty=0;

		for(String itr : readData.readLine().split("\\s+"))
			{
				if(Integer.parseInt(itr)<sizeLimit)
					{

						sum=sum+Integer.parseInt(itr);
								if(sum>wasteLimit)
									{sum=0;
										empty++;
									}
					}

			}

		System.out.println(empty);
	}
}


/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader readData=new BufferedReader(new InputStreamReader(System.in));
		String data[]=readData.readLine().split("\\s+");
		int numOranges=Integer.parseInt(data[0]);
		int sizeLimit=Integer.parseInt(data[1]);
		int wasteLimit=Integer.parseInt(data[2]);
		int sum=0;

		for(String itr : readData.readLine().split("\\s+"))
			{
				if(Integer.parseInt(itr)<sizeLimit)
					{
						sum=sum+Integer.parseInt(itr);
					}

			}

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


/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader readData=new BufferedReader(new InputStreamReader(System.in));
		String data[]=readData.readLine().split("\\s+");
		long numOranges=Integer.parseInt(data[0]);
		long sizeLimit=Integer.parseInt(data[1]);
		long wasteLimit=Integer.parseInt(data[2]);
		long sum=0;

		for(String itr : readData.readLine().split("\\s+"))
			{
				if(Integer.parseInt(itr)<sizeLimit)
					{
						sum=sum+Integer.parseInt(itr);
					}

			}

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


/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader readData=new BufferedReader(new InputStreamReader(System.in));
		String data[]=readData.readLine().split("\\s+");
		int numOranges=Integer.parseInt(data[0]);
		int sizeLimit=Integer.parseInt(data[1]);
		long wasteLimit=Integer.parseInt(data[2]);
		long sum=0;

		for(String itr : readData.readLine().split("\\s+"))
			{
				if(Integer.parseInt(itr)<sizeLimit)
					{
						sum=sum+Integer.parseInt(itr);
					}

			}

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


/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader readData=new BufferedReader(new InputStreamReader(System.in));
		String data[]=readData.readLine().split("\\s+");
		long numOranges=Integer.parseInt(data[0]);
		long sizeLimit=Integer.parseInt(data[1]);
		long wasteLimit=Integer.parseInt(data[2]);
		long sum=0,empty=0;

		for(String itr : readData.readLine().split("\\s+"))
			{
				if(Integer.parseInt(itr)<=sizeLimit)
					{

						sum=sum+Integer.parseInt(itr);
								if(sum>wasteLimit)
									{sum=0;
										empty++;
									}
					}

			}

		System.out.println(empty);
	}
}


/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader readData=new BufferedReader(new InputStreamReader(System.in));
		String data[]=readData.readLine().split("\\s+");
		long numOranges=Integer.parseInt(data[0]);
		long sizeLimit=Integer.parseInt(data[1]);
		long wasteLimit=Integer.parseInt(data[2]);
		long sum=0,empty=0;

		for(String itr : readData.readLine().split("\\s+"))
			{
				if(Integer.parseInt(itr)<=sizeLimit)
					{

						sum=sum+Integer.parseInt(itr);
								if(sum>=wasteLimit)
									{sum=0;
										empty++;
									}
					}

			}

		System.out.println(empty);
	}
}


package codeforces;

import java.util.Scanner;

public class codeforces {

	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,c=0;

		for(int i=0;i<n;i++)
		{
			int a = sc.nextInt();
			if(a < b)
				sum += a;
			else
				continue;
		   if (sum > d)
			{
				++c;
				sum = 0;
			}

		}
		System.out.println(c);
		sc.close();

	}

}


import java.util.Scanner;

public class codeforces {

	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,c=0;

		for(int i=0;i<n;i++)
		{
			int a = sc.nextInt();
			if(a < b)
				sum += a;
			else
				continue;
		   if (sum > d)
			{
				++c;
				sum = 0;
			}

		}
		System.out.println(c);
		sc.close();

	}

}


import java.util.Scanner;

public class codeforces {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n =sc.nextInt();
		int b = sc.nextInt();
		int d = sc.nextInt();

		long sum =0;
		for(int i=0;i<n;i++)
		{
			int a = sc.nextInt();
			if(a < b)
				sum += a;
			else
				continue;
		}
		System.out.println(sum/d);
		sc.close();

	}

}


import java.util.Scanner;

public class codeforces {

	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 sizes [] = new int[n];
		long sum =0;
		for(int i=0;i<n;i++)
		{
			sizes[i] = sc.nextInt();
			if(sizes[i] < b)
				sum += sizes[i];
		}
		System.out.println(sum/d);
		sc.close();

	}

}


import java.util.Scanner;

public class codeforces {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

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

		long sum =0,c=0;

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

			if(a <= b)
				sum += a;

		    if (sum > d)
			{
				++c;
				sum = 0;
			}
		    else
		    	continue;

		}
		System.out.println(c);
		sc.close();

	}

}


package codeforces;

import java.util.Scanner;

public class codeforces {

	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,c=0;

		for(int i=0;i<n;i++)
		{
			int a = sc.nextInt();
			if(a < b)
				sum += a;
			else if (sum >d)
			{
				++c;
				sum =0;
			}
			else
				continue;
		}
		System.out.println(c);
		sc.close();

	}

}


import java.util.Scanner;

public class codeforces {

	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 sizes [] = new int[n];
		int sum =0;
		for(int i=0;i<n;i++)
		{
			sizes[i] = sc.nextInt();
			if(sizes[i] < b)
				sum += sizes[i];
		}
		System.out.println(sum/d);
		sc.close();

	}

}


import java.io.PrintStream;

import java.util.Scanner;

public class MyClass {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        PrintStream printer = (System.out);

        int n = scanner.nextInt();
        int b= scanner.nextInt();
        int d= scanner.nextInt();
        scanner.nextLine();
        int count=0;

        String[] oranges= new String[n];
        float total=0;

        for( int i=0; i<n; i++){
            int v=scanner.nextInt();
            if(v>b){
                v=0;
            }
            oranges[i]=String.valueOf(v);
            total+=v;

        }
        while (true){
            if(total>d){
                count++;
                total-=d;
            }else {
                break;
            }
        }

        printer.print(count);

    }}