#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 123;
const long long INF = (long long)1e18 + 123;
const int inf = (int)1e9 + 123;
const int MOD = (int)1e9 + 7;
void megaRandom() {
  unsigned int FOR;
  asm("rdtsc" : "=A"(FOR));
  srand(FOR);
}
int n, m, h;
int a[N], b[N], add_em_up[N];
pair<int, int> t[(int)1e7];
void build(int v = 1, int tl = 1, int tr = m) {
  if (tl == tr) {
    t[v] = make_pair(-(m - tl + 1), 0);
    return;
  }
  int mid = (tl + tr) >> 1;
  build((v << 1), tl, mid);
  build((v << 1) + 1, mid + 1, tr);
  t[v].first = min(t[(v << 1)].first, t[(v << 1) + 1].first);
}
void push(int v, int tl, int tr) {
  if (!t[v].second) return;
  t[v].first += t[v].second;
  if (tl != tr) {
    t[(v << 1)].second += t[v].second;
    t[(v << 1) + 1].second += t[v].second;
  }
  t[v].second = 0;
}
void upd(int l, int r, int val, int v = 1, int tl = 1, int tr = m) {
  push(v, tl, tr);
  if (l > r || tl > tr || tl > r || l > tr) return;
  if (l <= tl && tr <= r) {
    t[v].second += val;
    push(v, tl, tr);
    return;
  }
  int mid = (tl + tr) >> 1;
  upd(l, r, val, (v << 1), tl, mid);
  upd(l, r, val, (v << 1) + 1, mid + 1, tr);
  t[v].first = min(t[(v << 1)].first, t[(v << 1) + 1].first);
}
int get(int l, int r, int v = 1, int tl = 1, int tr = m) {
  push(v, tl, tr);
  if (l > r || tl > tr || tl > r || l > tr) return inf;
  if (l <= tl && tr <= r) return t[v].first;
  int mid = (tl + tr) >> 1;
  return min(get(l, r, (v << 1), tl, mid),
             get(l, r, (v << 1) + 1, mid + 1, tr));
}
int main() {
  megaRandom();
  scanf("%d%d%d", &n, &m, &h);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(b + 1, b + n + 1);
  reverse(b + 1, b + n + 1);
  for (int i = 1; i <= m; i++) add_em_up[i] = h - b[i];
  build();
  add_em_up[m + 1] = inf;
  for (int i = 1; i <= m; i++) {
    if (add_em_up[1] > a[i]) continue;
    int l = 1, r = m + 1;
    while (r - l > 1) {
      int mid = (l + r) >> 1;
      if (add_em_up[mid] <= a[i])
        l = mid;
      else
        r = mid;
    }
    upd(1, l, 1);
  }
  int res = 0;
  if (get(1, m) >= 0) res++;
  for (int i = m + 1; i <= n; i++) {
    if (add_em_up[1] <= a[i - m]) {
      int l = 1, r = m + 1;
      while (r - l > 1) {
        int mid = (l + r) >> 1;
        if (add_em_up[mid] <= a[i - m])
          l = mid;
        else
          r = mid;
      }
      upd(1, l, -1);
    }
    if (add_em_up[1] <= a[i]) {
      int l = 1, r = m + 1;
      while (r - l > 1) {
        int mid = (l + r) >> 1;
        if (add_em_up[mid] <= a[i])
          l = mid;
        else
          r = mid;
      }
      upd(1, l, 1);
    }
    if (get(1, m) >= 0) res++;
  }
  printf("%d", res);
  return 0;
}
