#include <bits/stdc++.h>
using namespace std;
const long long MaxN = 100101;
template <class t>
inline void rd(t &s) {
  s = 0;
  register char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  return;
}
long long a[MaxN], b[MaxN];
long long ans, res;
struct SegTree {
  long long A[MaxN << 2], lazy[MaxN << 2];
  inline void buildtr(long long p, long long l, long long r) {
    if (l == r) {
      A[p] = a[l];
      return;
    }
    long long mid = (l + r) >> 1;
    buildtr(p << 1, l, mid);
    buildtr(p << 1 | 1, mid + 1, r);
    A[p] = max(A[p << 1], A[p << 1 | 1]);
    return;
  }
  inline void pushdown(long long p) {
    lazy[p << 1] += lazy[p];
    lazy[p << 1 | 1] += lazy[p];
    A[p << 1] += lazy[p];
    A[p << 1 | 1] += lazy[p];
    lazy[p] = 0;
  }
  inline void changep(long long p, long long l, long long r, long long x,
                      long long y, long long c) {
    if (x <= l && r <= y) {
      A[p] += c;
      lazy[p] += c;
      return;
    }
    pushdown(p);
    long long mid = (l + r) >> 1;
    if (x <= mid) changep(p << 1, l, mid, x, y, c);
    if (mid < y) changep(p << 1 | 1, mid + 1, r, x, y, c);
    A[p] = max(A[p << 1], A[p << 1 | 1]);
    return;
  }
  inline long long query(long long p, long long l, long long r, long long x) {
    if (l == r) return A[p];
    pushdown(p);
    long long mid = (l + r) >> 1;
    if (x <= mid)
      return query(p << 1, l, mid, x);
    else
      return query(p << 1 | 1, mid + 1, r, x);
  }
} tree;
signed main(void) {
  long long n, m, k;
  rd(n);
  rd(m);
  rd(k);
  for (long long i = 1; i <= m; ++i) rd(a[i]), --a[i];
  tree.buildtr(1, 1, m);
  register long long A = 1;
  while (A <= m) {
    ++res;
    register long long l = A, r = m + 1, mid, ans = l;
    register long long ql = tree.query(1, 1, m, A) / k * k;
    register long long qr = ql - 1 + k;
    while (l < r) {
      mid = (l + r) >> 1;
      if (tree.query(1, 1, m, mid) > qr)
        r = mid;
      else
        ans = mid, l = mid + 1;
    }
    tree.changep(1, 1, m, ans + 1, m, A - ans - 1);
    A = ans + 1;
  }
  printf("%lld", res);
  return 0;
}
