#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
const long long inf = 1e18 + 5;
const long long N = 2e5 + 5;
long long n, len, h, a[N], b[N], ans;
long long seg[N << 2], lazy[N << 2];
void build(long long id = 1, long long l = 0, long long r = N) {
  if (r - l == 1) {
    seg[id] = -l;
    return;
  }
  long long mid = l + r >> 1;
  build(id << 1, l, mid);
  build(id << 1 | 1, mid, r);
  seg[id] = min(seg[id << 1], seg[id << 1 | 1]);
}
void shift(long long id) {
  lazy[id << 1] += lazy[id];
  lazy[id << 1 | 1] += lazy[id];
  seg[id << 1] += lazy[id];
  seg[id << 1 | 1] += lazy[id];
  lazy[id] = 0;
}
void update(long long ql, long long qr, long long val, long long id = 1,
            long long l = 0, long long r = N) {
  if (qr <= l || ql >= r || qr <= ql || r <= l) return;
  if (ql <= l && qr >= r) {
    seg[id] += val;
    lazy[id] += val;
    return;
  }
  long long mid = (l + r) / 2;
  shift(id);
  update(ql, qr, val, id << 1, l, mid);
  update(ql, qr, val, id << 1 | 1, mid, r);
  seg[id] = min(seg[id << 1], seg[id << 1 | 1]);
}
long long get(long long ql, long long qr, long long id = 1, long long l = 0,
              long long r = N) {
  if (qr <= l || ql >= r || qr <= ql || r <= l) return inf;
  if (ql <= l && qr >= r) return seg[id];
  long long mid = (l + r) / 2;
  shift(id);
  return min(get(ql, qr, id << 1, l, mid), get(ql, qr, id << 1 | 1, mid, r));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> len >> h;
  for (long long i = 1; i <= len; i++) cin >> b[i];
  for (long long i = 1; i <= n; i++) cin >> a[i];
  build();
  sort(b + 1, b + len + 1);
  for (long long i = 1; i <= len; i++)
    update(lower_bound(b + 1, b + len + 1, h - a[i]) - b, len + 1, 1);
  long long ptr = 1;
  while (ptr + len - 1 <= n) {
    if (get(1, len + 1) >= 0) ans++;
    update(lower_bound(b + 1, b + len + 1, h - a[ptr]) - b, len + 1, -1);
    update(lower_bound(b + 1, b + len + 1, h - a[ptr + len]) - b, len + 1, 1);
    ptr++;
  }
  cout << ans << endl;
}
