#include <bits/stdc++.h>
using namespace std;
const int N = 160000;
int i, j, k, l, m, n, o, p, H, a[N], b[N], rk[N];
struct arr {
  int w, i;
  inline bool operator<(const arr &t) const { return w < t.w; }
} A[N];
struct brr {
  int l, r, b, Min;
} s[N << 2];
inline int read() {
  int o = 0;
  char c = getchar();
  while ((c < '0') || (c > '9')) c = getchar();
  while ((c >= '0') && (c <= '9')) {
    o = o * 10 + c - '0';
    c = getchar();
  }
  return o;
}
inline void Init() {
  n = read();
  m = read();
  H = read();
  for (i = 1; i <= m; i++) b[i] = read();
  for (i = 1; i <= n; i++) a[i] = read();
  sort(b + 1, b + m + 1);
  for (i = 1; i <= m >> 1; i++) swap(b[i], b[m - i + 1]);
}
inline void Prepare() {
  int mid;
  for (i = 1; i <= n; i++) {
    o = 1;
    p = m;
    while (o <= p) {
      mid = o + p >> 1;
      if (b[mid] + a[i] >= H)
        o = mid + 1;
      else
        p = mid - 1;
    }
    A[i].w = p;
    A[i].i = i;
  }
  sort(A + 1, A + n + 1);
  for (i = 1; i <= n; i++) rk[A[i].i] = i;
}
inline void update(int i) { s[i].Min = min(s[i << 1].Min, s[i << 1 | 1].Min); }
inline void Build(int i, int L, int R) {
  int mid = L + R >> 1;
  s[i].l = L;
  s[i].r = R;
  if (L == R) {
    s[i].Min = A[L].w;
    s[i].b = 0;
  } else {
    Build(i << 1, L, mid);
    Build(i << 1 | 1, mid + 1, R);
    update(i);
  }
}
inline void push(int i, int b) {
  s[i].b += b;
  s[i].Min += b;
}
inline void change(int i, int L, int R, int b) {
  int l = s[i].l, r = s[i].r, mid = s[i].l + s[i].r >> 1;
  if ((L <= l) && (r <= R))
    push(i, b);
  else {
    push(i << 1, s[i].b);
    push(i << 1 | 1, s[i].b);
    s[i].b = 0;
    if (L <= mid) change(i << 1, L, R, b);
    if (mid < R) change(i << 1 | 1, L, R, b);
    update(i);
  }
}
inline int Query(int i, int L, int R) {
  int l = s[i].l, r = s[i].r, mid = s[i].l + s[i].r >> 1;
  if ((L <= l) && (r <= R))
    return s[i].Min;
  else {
    push(i << 1, s[i].b);
    push(i << 1 | 1, s[i].b);
    s[i].b = 0;
    int ans = 1 << 30;
    if (L <= mid) ans = min(ans, Query(i << 1, L, R));
    if (mid < R) ans = min(ans, Query(i << 1 | 1, L, R));
    return ans;
  }
}
inline int Solve() {
  int i, j, k, ans = 0;
  for (i = 1; i <= m; i++) change(1, rk[i], n, -1);
  for (i = 1; i <= n - m + 1; i++) {
    ans += (Query(1, 1, n) >= 0);
    if (i < n - m + 1) {
      change(1, rk[i], n, 1);
      change(1, rk[i + m], n, -1);
    }
  }
  return ans;
}
int main() {
  Init();
  Prepare();
  Build(1, 1, n);
  cout << Solve() << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
