#include <bits/stdc++.h>
using namespace std;
int a[200010], b[200010], addmark[600010], minn[600010], tot = 0;
void pushdown(int rt) {
  if (addmark[rt]) {
    addmark[rt * 2] += addmark[rt];
    addmark[rt * 2 + 1] += addmark[rt];
    minn[rt * 2] += addmark[rt];
    minn[rt * 2 + 1] += addmark[rt];
    addmark[rt] = 0;
  }
}
void update(int rt, int l, int r, int x, int y, int z) {
  if (l > y || r < x) return;
  if (l >= x && r <= y) return addmark[rt] += z, minn[rt] += z, void();
  pushdown(rt);
  int mid = (l + r) / 2;
  update(rt * 2, l, mid, x, y, z);
  update(rt * 2 + 1, mid + 1, r, x, y, z);
  minn[rt] = min(minn[rt * 2], minn[rt * 2 + 1]);
}
int main() {
  int n, m, h, t, ans = 0;
  cin >> n >> m >> h;
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  sort(a + 1, a + m + 1);
  for (int i = 1; i <= m; i++) update(1, 1, m, i, i, -i);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= m; i++)
    update(1, 1, m, lower_bound(a + 1, a + m + 1, h - b[i]) - a, m, 1);
  ans += (minn[1] >= 0);
  for (int i = m + 1; i <= n; i++) {
    update(1, 1, m, lower_bound(a + 1, a + m + 1, h - b[i - m]) - a, m, -1);
    update(1, 1, m, lower_bound(a + 1, a + m + 1, h - b[i]) - a, m, 1);
    ans += (minn[1] >= 0);
  }
  cout << ans << endl;
  return 0;
}
