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

public class D {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static FastReader scn = new FastReader();

    public static void main(String[] args) {
        int n = scn.nextInt();
        int k = scn.nextInt();

        long count = 0, prev = 0;
        for(int i = 0; i<n; i++){
            long a = scn.nextLong() + prev;
            long b = a/k;
            if(prev!=0 && b==0){
                count ++;
                prev = 0;
            }else{
                count += a/k;
                prev = a%k;
            }
        }
        if(prev !=0) count++;

        System.out.println(count);
    }
}