#include<bits/stdc++.h>
#include<random>
using namespace std;
 
#define ff first
#define ss second
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define readInputFile freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define eb emplace_back
#define pf push_front
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define ff first
#define ss second
#define mem(a, b) memset(a, (b), sizeof(a))
#define po pop_back
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define print2d(mat,n,m){for(int i=0;i<(int)(n);i++){for(int j=0;j<(m);j++){cout<<mat[i][j]<<" ";}cout<< endl;}}
#define endl "\n"
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<vector<ll>> vvll;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<int> vii;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<pll> vpll;
typedef vector<pld> vpld;
typedef pair<int, int> pi;
typedef vector<pi> vpii;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef set<ll> sll;
 
void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(ld t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}
 
 
//debug template
void __print(int x) {cerr << x;} void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;} void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;} void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;} void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';} void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
 template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.ff); cerr << ","; _print(p.ss); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";cerr << "]"<<endl;}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";cerr << "]" << endl;}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]" << "]"<<endl;}
 
//Print Template.
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second);
    cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""),
                __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
template <typename T>
void print(vector <T> v) {
    for (T i : v) cout << i << " ";
    cout << '\n';
}
 
template <typename T>
void print(vector <vector <T>>& v) {
    for (vector <T>& vv : v) {
        for (T& i : vv)
            cout << i << " ";
        cout << '\n';
    }
}
template <typename T>
void read(vector <T>& v) {for (T& i : v) cin >> i;}
 
template <typename T>
void read(T&& t) {cin >> t;}
 
template <typename T, typename... Args>
void read(T&& t, Args&&... args)
{
    cin >> t;
    read(forward<Args>(args)...);
}
 
template <typename T>
void print(T&& t) {cout << t << '\n';}
 
template <typename T, typename... Args>
void print(T&& t, Args&&... args)
{
    cout << t << " ";
    print(forward<Args>(args)...);
}
 
template<typename T>             vector<T>& operator--            (vector<T>& v){for (auto& i : v) --i;            return  v;}
template<typename T>             vector<T>& operator++            (vector<T>& v){for (auto& i : v) ++i;            return  v;}
template<typename T>             istream& operator>>(istream& is,  vector<T>& v){for (auto& i : v) is >> i;        return is;}
template<typename T>             ostream& operator<<(ostream& os,  vector<T>& v){for (auto& i : v) os << i << ' '; return os;}
 
bool isprime(ll n){
    if(n<=1){return false;}
    if(n<=3){return true;}
    if(n%2==0||n%3==0){return false;}
    for(ll i=5;i*i<=n;i+=6){
        if(n%i==0||n%(i+2)==0){return false;}
    }
    return true;
}
ll binpow(ll a, ll b, ll m) {
    a %= m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a) % m;
        a = (a * a)% m;
        b >>= 1;
    }
    return res;
}
ll modInverse(ll n, ll mod){
    return binpow(n,mod-2,mod);
}
ll comb(ll n, ll r, ll p) {
    if (r == 0 or n == r) return 1;
    ll fac[n+1]; fac[0] = 1;
    for(ll i = 1; i <= n; i++){fac[i] = fac[i-1] * i; fac[i] %= p; }
    return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p;
}
sll divisors(ll n){
	sll s;
	for(ll i=1; i*i<=n;i++){
		if(n%i==0){
			s.insert(i);
			s.insert(n/i);
		}
	}
	return s;
}
int lcm(int a, int b)
{
	return (a * b) / __gcd(a, b);
}
vll primes;
sll primess; 
void seive(){
	vector<int> is_prime(1e6+1, true);
	is_prime[0] = is_prime[1] = false;
	for (int i = 2; i * i <= 1e6; i++) {
	    if (is_prime[i]) {
	        for (int j = i * i; j <= 1e6; j += i)
	            is_prime[j] = false;
	    }
	}
	for(int i=2;i<=1e6;i++){
		if(is_prime[i]){
			primes.pb(i);
			primess.insert(i);
		}
	}
}
map<ll,ll> primeFactors(ll n)  
{  
	map<ll,ll> m;
    while (n % 2 == 0)  
    {  
        m[2]++;
        n = n/2;  
    }  
    for (ll i = 3; i <= sqrt(n); i = i + 2)  
    {  
        while (n % i == 0)  
        {  
            m[i]++; 
            n = n/i;  
        }  
    }    
    if (n > 2)  
        m[n]++;  
    return m;
}
ll fact(ll n){
	ll res =1;
	for(ll i=1;i<=n;i++){
		res *=  i;
	}
	return res;
}
ll C(ll n,ll r){
	ll res =1;
	for(ll i=0;i<r;i++){
		res = res * (n-i) / (i+1);
	}
	return res;
}
ll toint(string s){
	ll num =0;
	for(ll i=0;i<s.size();i++){
		num = num* 10 + s[i] -'0';
	}
	return num;
}
ll sumstring (string s){
	ll sum =0;
	for(ll i =0;i<s.size();i++){
		sum += (s[i] -'0');
	}
	return sum;
}
ll sumdigit (ll n){
	ll sum =0;
	while(n){
		ll rem = n%10;
		sum += rem;
		n/=10;
	}
	return sum;
}
string tobinary(ll x){
	string a;
	while(x > 0){
		a += (x % 2) + '0';
		x /= 2;
	}
	reverse(all(a));
	return a;
}

ll todecimal(string x){
	ll sum = 0;
	ll n = x.size();
	ll j =0;
	for(ll i= n-1;i>=0;i--){
		if(x[i] == '1'){
			sum += (1LL << j);
		}
		j++;
	}
	return sum;
}
ll ceil(ll n, ll k){
	return (n + k -1) / k;
}
bool ispermutation(vll p){
	sort(all(p));
	for(ll i =1;i<=p.size();i++){
		if(p[i-1] != i)
			return false;
	}
	return true;
}
bool isperfect(ll x){
	ll a = sqrtl(x);
	return a*a == x;
}
bool issubsequence(string t, string x){
	ll j =0;
	for(ll i=0;i<x.size();i++){
		if(x[i] == t[j]){
			j++;
		}
		if(j == t.size())
			break;
	}
	return j == t.size();
}


void solve(){
	ll n,k;
	cin>>n>>k;
	vll v(n);
	cin>>v;
	ll bags = 0;
	ll cursum = 0; ll days = 0;
	for(ll i=0;i<n-1;i++){
		cursum += v[i] + v[i+1];
		if(cursum <= k){
			bags += 1;
			i++;
			cursum = 0;
		}
		else{
			bags += cursum / k;
			cursum %= k;
			i++;
		}
	}
	if(n & 1)
		cursum += v[n-1];
	if(cursum)
		bags += ceil(cursum , k);
	print(bags);
}	




 
int32_t  main(){
	fast;
	ll t;
	// cin>>t;
	t =1;	
	// seive();
	while(t--){
		solve();
	}
}