#include <bits/stdc++.h>
using namespace std;
const int N = 150005;
int n, m, h, v, ans, a[N], b[N], c[N * 4], d[N * 4];
void build(int t, int l, int r) {
  if (l == r)
    c[t] = m - l;
  else {
    int mid = l + r >> 1;
    build(t * 2, l, mid), build(t * 2 + 1, mid + 1, r),
        c[t] = min(c[t * 2], c[t * 2 + 1]);
  }
}
void down(int t, int &A) {
  d[t] += A, c[t] += A, d[t + 1] += A, c[t + 1] += A, A = 0;
}
void modify(int t, int l, int r, int ll, int rr) {
  if (l == ll && r == rr) {
    d[t] += v, c[t] += v;
    return;
  }
  int mid = l + r >> 1;
  if (d[t]) down(t * 2, d[t]);
  if (rr <= mid)
    modify(t * 2, l, mid, ll, rr);
  else if (ll > mid)
    modify(t * 2 + 1, mid + 1, r, ll, rr);
  else
    modify(t * 2, l, mid, ll, mid), modify(t * 2 + 1, mid + 1, r, mid + 1, rr);
  c[t] = min(c[t * 2], c[t * 2 + 1]);
}
int main() {
  scanf("%d%d%d", &n, &m, &h);
  for (int i = 0; i < m; ++i) scanf("%d", b + i);
  sort(b, b + m);
  for (int i = 0; i < n; ++i)
    scanf("%d", a + i), a[i] = lower_bound(b, b + m, h - a[i]) - b;
  build(1, 0, m);
  for (int i = 0; i < n; ++i) {
    v = -1, modify(1, 0, m, 0, a[i]);
    if (i >= m - 1) ans += c[1] >= 0, v = 1, modify(1, 0, m, 0, a[i - m + 1]);
  }
  printf("%d\n", ans);
  return 0;
}
