#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
struct node {
  long long times;
  long long modu;
  long long already;
} a[200086];
long long x;
long long now, num, tot, thi, ok, ans;
long long last;
long long p[200086];
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= m; i++) {
    cin >> x;
    x--;
    a[i].times = x / k;
    a[i].modu = x % k;
    p[i] = x % k;
  }
  now = 1;
  while (now <= m) {
    tot = a[now].times * k + a[now].modu;
    if (!a[now].already) {
      tot -= last;
      a[now].modu = tot % k;
      a[now].times = tot / k;
      a[now].already = 1;
    }
    if (ok == 0) {
      thi = (a[now].times * k + a[now].modu - (num - last)) / k, ans++, ok = 1;
      last = num, num++;
    } else {
      if (a[now].times == thi) {
        num++;
      } else {
        ok = 0;
        continue;
      }
    }
    now++;
  }
  cout << ans << endl;
  return 0;
}
