#include <bits/stdc++.h>
using namespace std;
template <typename T, typename L>
bool smax(T &x, L y) {
  return x < y ? (x = y, true) : false;
}
template <typename T, typename L>
bool smin(T &x, L y) {
  return y < x ? (x = y, true) : false;
}
void update(int, int, int, int, int, int);
const int MAXN = 15e4 + 15;
int tree[MAXN << 2], lz[MAXN << 2];
int n, len, h, m;
int a[MAXN], b[MAXN];
int ans;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cerr << "HELLO WORLD :)\n";
  cin >> n >> len >> h;
  for (int i = 0; i < len; i++) cin >> b[i];
  m = len;
  sort(b, b + m);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) update(1, 0, n, i, i + 1, m - i);
  for (int i = 0; i < m; i++)
    update(1, 0, n, 0, lower_bound(b, b + m, h - a[i]) - b + 1, -1);
  ans += (tree[1] >= 0);
  for (int i = 0; i + m < n; i++) {
    update(1, 0, n, 0, lower_bound(b, b + m, h - a[i]) - b + 1, 1);
    update(1, 0, n, 0, lower_bound(b, b + m, h - a[i + m]) - b + 1, -1);
    ans += (tree[1] >= 0);
  }
  return cout << ans << '\n', false;
}
void update(int id, int b, int e, int l, int r, int val) {
  if (b >= r || e <= l) return;
  if (b >= l && e <= r) {
    tree[id] += val;
    lz[id] += val;
    return;
  }
  int mid = (b + e) >> 1;
  update(id << 1, b, mid, l, r, val);
  update(id << 1 | 1, mid, e, l, r, val);
  tree[id] = min(tree[id << 1], tree[id << 1 | 1]) + lz[id];
}
