#include <bits/stdc++.h>
int inp() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum;
}
int a[150010], b[150010], pos[150010];
struct SEG_Tree {
  struct SEG {
    int l;
    int r;
    int min;
    int lazy;
  } t[600000];
  inline void push_up(int cur) {
    t[cur].min = std::min(t[((cur) << 1)].min, t[((cur) << 1 | 1)].min);
  }
  inline void push_down(int cur) {
    t[((cur) << 1)].lazy += t[cur].lazy;
    t[((cur) << 1)].min += t[cur].lazy;
    t[((cur) << 1 | 1)].lazy += t[cur].lazy;
    t[((cur) << 1 | 1)].min += t[cur].lazy;
    t[cur].lazy = 0;
  }
  void build(int cur, int l, int r) {
    t[cur].l = l;
    t[cur].r = r;
    t[cur].lazy = 0;
    if (l == r) {
      t[cur].min = -l;
      return;
    }
    int mid = (l + r) >> 1;
    build(((cur) << 1), l, mid);
    build(((cur) << 1 | 1), mid + 1, r);
    push_up(cur);
  }
  void modify(int cur, int l, int r, int c) {
    if (t[cur].l > r || t[cur].r < l) return;
    if (t[cur].l >= l && t[cur].r <= r) {
      t[cur].min += c;
      t[cur].lazy += c;
      return;
    }
    push_down(cur);
    modify(((cur) << 1), l, r, c);
    modify(((cur) << 1 | 1), l, r, c);
    push_up(cur);
  }
} t;
int main() {
  int n = inp();
  int len = inp();
  int h = inp();
  for (int i = 1; i <= len; i++) b[i] = inp();
  for (int i = 1; i <= n; i++) a[i] = inp();
  std::sort(b + 1, b + len + 1);
  for (int i = 1; i <= n; i++)
    pos[i] = std::lower_bound(b + 1, b + len + 1, h - a[i]) - b;
  t.build(1, 1, len);
  for (int i = 1; i < len; i++) t.modify(1, pos[i], len, 1);
  int ans = 0;
  for (int i = 1; i <= n - len + 1; i++) {
    t.modify(1, pos[i + len - 1], len, 1);
    if (t.t[1].min >= 0) ans++;
    t.modify(1, pos[i], len, -1);
  }
  printf("%d\n", ans);
}
