#include <bits/stdc++.h>
using namespace std;
const int N = (int)3e5 + 50;
struct node {
  int lmax, sum;
  void set_node(int val) {
    sum = val;
    lmax = max(0, val);
  }
  void merge(node &LHS, node &RHS) {
    sum = LHS.sum + RHS.sum;
    lmax = max(LHS.lmax, LHS.sum + RHS.lmax);
  }
};
int val[N];
struct Tree {
  node dat[N * 4];
  void init_dat(int x, int l, int r) {
    if (l == r) {
      dat[x].set_node(val[l]);
      return;
    }
    int mid = (l + r) / 2;
    init_dat(2 * x + 1, l, mid);
    init_dat(2 * x + 2, mid + 1, r);
    dat[x].merge(dat[2 * x + 1], dat[2 * x + 2]);
  }
  void update(int pos, int x, int l, int r, int d) {
    int mid = (l + r) / 2;
    if (l == r) {
      dat[x].set_node(dat[x].sum + d);
      return;
    }
    if (pos <= mid)
      update(pos, 2 * x + 1, l, mid, d);
    else
      update(pos, 2 * x + 2, mid + 1, r, d);
    dat[x].merge(dat[2 * x + 1], dat[2 * x + 2]);
  }
} tree;
int n, m, len, h;
int a[N], b[N];
vector<int> vals;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> h;
  for (int i = 0; i < (m); ++i) cin >> b[i], vals.push_back(b[i]);
  for (int i = 0; i < (n); ++i)
    cin >> a[i], a[i] = h - a[i], vals.push_back(a[i]);
  sort(begin(vals), end(vals));
  vals.resize(unique(begin(vals), end(vals)) - vals.begin());
  for (int i = 0; i < (m); ++i)
    b[i] = (lower_bound(begin(vals), end(vals), b[i]) - vals.begin()),
    val[b[i]]++;
  for (int i = 0; i < (n); ++i)
    a[i] = (lower_bound(begin(vals), end(vals), a[i]) - vals.begin());
  len = (int)(vals).size();
  for (int i = 0; i < (m); ++i) val[a[i]]--;
  tree.init_dat(0, 0, len - 1);
  int ans = (tree.dat[0].lmax == 0);
  for (int i = m; i < (n); ++i) {
    tree.update(a[i - m], 0, 0, len - 1, 1);
    tree.update(a[i], 0, 0, len - 1, -1);
    ans += (tree.dat[0].lmax == 0);
  }
  cout << ans << '\n';
}
