#include <bits/stdc++.h>
using namespace std;
const long long maxN = 3e5 + 7, MOD = 1e9 + 7, INF = 1e10, N = 5000 + 7;
long long n, len, data[4 * maxN], cnt[4 * maxN], helper[4 * maxN], a[maxN],
    b[maxN], ind[maxN], dp[maxN], h, ans;
vector<pair<int, int> > q;
inline int left(int x) { return 2 * x + 1; }
inline int right(int x) { return 2 * x + 2; }
void shift(int node) {
  data[left(node)] += helper[node];
  data[right(node)] += helper[node];
  helper[left(node)] += helper[node];
  helper[right(node)] += helper[node];
  helper[node] = 0;
}
void add(int node, int st, int en, int l, int r, int val) {
  if (r <= st || en <= l) return;
  if (st >= l && en <= r) {
    data[node] += val, helper[node] += val;
    return;
  }
  shift(node);
  int mid = (st + en) >> 1;
  add(left(node), st, mid, l, r, val);
  add(right(node), mid, en, l, r, val);
  data[node] = min(data[left(node)], data[right(node)]);
}
void up(int node, int st, int en, int index) {
  if (index < st || en <= index) return;
  cnt[node]++;
  if (en - st < 2) return;
  int mid = (st + en) >> 1;
  up(left(node), st, mid, index);
  up(right(node), mid, en, index);
}
int get(int node, int st, int en, int l, int r) {
  if (en <= l || r <= st) return 0;
  if (st >= l && en <= r) return cnt[node];
  int mid = (st + en) >> 1;
  return get(left(node), st, mid, l, r) + get(right(node), mid, en, l, r);
}
int main() {
  cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
  cin >> n >> len >> h;
  for (int i = 0; i < len; i++)
    cin >> b[i], b[i] = h - b[i], q.push_back(pair<int, int>(b[i], i));
  for (int i = 0; i < n; i++)
    cin >> a[i], q.push_back(pair<int, int>(a[i], len + i));
  sort(q.begin(), q.end());
  int pointer = 0;
  for (int i = 0; i < q.size(); i++) {
    if (q[i].second >= len)
      dp[q[i].second - len] = pointer - 1;
    else {
      add(0, 0, len, 0, pointer + 1, -1);
      up(0, 0, len, pointer);
      pointer++;
    }
  }
  for (int i = 0; i < len; i++) add(0, 0, len, 0, dp[i] + 1, 1);
  for (int i = 0; i < n - len + 1; i++) {
    if (data[0] >= 0) ans++;
    add(0, 0, len, 0, dp[i] + 1, -1);
    add(0, 0, len, 0, dp[i + len] + 1, 1);
  }
  return cout << ans << "\n", 0;
}
