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

typedef long long ll;
#define pb        push_back
#define mp        make_pair
#define pi        3.1415926536
#define asort(v)  sort(v.begin(),v.end())
#define dsort(v)  sort(v.begin(),v.end(),greater<int>())
#define uniq(v)   v.erase(unique(v.begin(),v.end(),v.end())

ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}

ll lcm(ll a,ll b){ return ((ll)a*(ll)b)/__gcd(a,b);}
 
ll nCr(ll n,ll r){ll res=1;if(n<r)return -1;r=min(r,n-r);
    for(ll i=0;i<r;i++){res*=(n-i);res/=(i+1);}return res;}
 
ll nPr(ll n,ll r){ll res=1;if(n<r)return -1;
    for(ll i=0;i<r;i++)res*=(n-i);return res;}

ll power( ll b, ll e){ if(e==0) return 1;
    if(e&1) return b*power(b*b,e/2);
    return power(b*b,e/2);}

ll digit(ll x){ ll ans=0;
    while(x){ans+=x%10;x/=10;}
    return ans;}

ll ndigit(ll x){ ll ans=0;
    while(x){ans++;x/=10;}
    return ans;}    

bool isPrime(ll n){if(n<=1)return false;if(n<=3)return true;
    if(n%2==0||n%3==0)return false;for(int i=5;i*i<=n;i=i+6)
    if(n%i==0||n%(i+2)==0)return false;return true;}

ll countDivisors(ll n){ll cnt = 0;for (ll i=1;i<=sqrt(n);i++){
    if(n%i==0){if(n/i==i){cnt++;}
    else{cnt=cnt+2;}}} return cnt;} 

void napster()
{ 
    ll i,j,sum=0,ans;
    ll n,k;
    cin>>n>>k;
    ll a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll y=0;
    ll x;
    ll zz=0;
    for(i=0;i<n;i++)
    {
        
        if(i==n-1)
        {

            if((a[i]+y)%k==0)
            {
                sum=sum+(a[i]+y)/k;
            }
            else
            {
                sum=sum+(a[i]+y)/k+1;
            }
        }
        else
        {
        x=(a[i]+y)/k;
        if(x==0&&a[i]+y>0&&zz==1)
        {
            zz=0;
            x=x+1;
            y=0;
        }
        else
        {
            zz++;
            y=a[i]-x*k;
        }
        sum=sum+x;
        
        }
    }
    cout<<sum;
    

    
   


    
    //damnnnnnnnnnnnnnnnnnnnn
}

signed main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    
    ll T=1;
    //cin>>T;
    while(T--)
    { 
       napster();
    } 
    cerr << "Time taken: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}

// Prashant Singh @Real_Napster
//Never gonna give you up!