#include <bits/stdc++.h>
inline int getint() {
  int x = 0, p = 1;
  char c = getchar();
  while (c <= 32) c = getchar();
  if (c == 45) p = -p, c = getchar();
  while (c > 32) x = x * 10 + c - 48, c = getchar();
  return x * p;
}
using namespace std;
const int N = 150000 + 10;
bool flag = true;
multiset<int> S;
multiset<int>::iterator it;
int n, len, m, sz = 1, res, to[N], a[N], b[N], dat[N << 2], tag[N << 2];
vector<int> ord, v;
void pd(int k) {
  if ((k * 2 + 2) < (N << 2) && tag[k] != 0) {
    dat[2 * k + 1] += tag[k];
    dat[2 * k + 2] += tag[k];
    tag[2 * k + 1] += tag[k];
    tag[2 * k + 2] += tag[k];
    tag[k] = 0;
  }
}
void fM2(int x, int l, int r, int k, int del) {
  pd(k);
  if (r - l == 1) {
    dat[k] = del;
    return;
  }
  int mid = (l + r) >> 1;
  if (x < mid)
    fM2(x, l, mid, 2 * k + 1, del);
  else
    fM2(x, mid, r, 2 * k + 2, del);
  dat[k] = min(dat[2 * k + 1], dat[2 * k + 2]);
}
void fM(int x, int y, int l, int r, int k, int del) {
  pd(k);
  if (r <= x || l >= y) return;
  if (x <= l && r <= y) {
    dat[k] += del;
    tag[k] += del;
    return;
  }
  fM(x, y, l, (l + r) >> 1, 2 * k + 1, del);
  fM(x, y, (l + r) >> 1, r, 2 * k + 2, del);
  dat[k] = min(dat[2 * k + 1], dat[2 * k + 2]);
}
int fQ(int x, int l, int r, int k) {
  pd(k);
  if (r - l == 1) return dat[k];
  int mid = (l + r) >> 1;
  if (x < mid)
    return fQ(x, l, mid, 2 * k + 1);
  else
    return fQ(x, mid, r, 2 * k + 2);
}
bool fQ() { return dat[0] >= 0; }
int main() {
  n = getint();
  len = getint();
  m = getint();
  for (int(i) = 0; (i) < (len); (i)++) b[i] = getint();
  sort(b, b + len);
  for (int(i) = 0; (i) < (n); (i)++) {
    a[i] = getint();
    ord.push_back(a[i]);
    if (i < len) v.push_back(a[i]);
  }
  sort(ord.begin(), ord.end());
  ord.resize(unique(ord.begin(), ord.end()) - ord.begin());
  for (int(i) = 0; (i) < (ord.size()); (i)++) {
    int x = m - ord[i], p = lower_bound(b, b + len, x) - b;
    to[i] = p;
  }
  while (sz < ord.size()) sz <<= 1;
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  fM(0, sz, 0, sz, 0, 1000000000);
  for (int(i) = 0; (i) < (len); (i)++) {
    if (v[i] + b[i] < m) {
      flag = false;
    }
    int x = lower_bound((ord).begin(), (ord.end()), v[i]) - ord.begin();
    if (S.find(x) == S.end()) {
      fM2(x, 0, sz, 0, i - to[x]);
    }
    S.insert(x);
  }
  if (fQ()) res++;
  for (int i = len; i < n; i++) {
    int x = lower_bound((ord).begin(), (ord.end()), a[i - len]) - ord.begin();
    int y = lower_bound((ord).begin(), (ord.end()), a[i]) - ord.begin();
    fM(0, x, 0, sz, 0, -1);
    S.erase(S.find(x));
    if (S.find(x) == S.end()) {
      fM2(x, 0, sz, 0, 1000000000);
    }
    fM(0, y, 0, sz, 0, 1);
    if (S.find(y) == S.end()) {
      it = S.upper_bound(y);
      int z;
      if (it != S.end()) {
        z = fQ(*it, 0, sz, 0) + to[*it] + 1;
      } else
        z = 0;
      fM2(y, 0, sz, 0, z - to[y]);
    }
    S.insert(y);
    if (fQ()) res++;
  }
  printf("%d\n", res);
  return 0;
}
