#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000")
using namespace std;
const int INF = 1000000000;
const int MAX = 1 << 19;
const int MAX2 = 1 << 18;
int n, m, h;
int A[MAX];
int B[MAX];
int AA[MAX];
int BB[MAX];
int I[MAX];
int C[MAX];
int D[MAX];
int W[MAX];
int M[MAX];
int Cnt[MAX];
void upd(int x) {
  int m = INF;
  for (int i = (x * 300); i < (x * 300 + 300); ++i) {
    W[i] += D[x];
    m = min(m, W[i]);
  }
  M[x] = m;
  D[x] = 0;
}
void add(int l, int r, int d) {
  int ll = l;
  while (l <= r)
    if ((l % 300 == 0) && (l + 300 - 1 <= r)) {
      D[l / 300] += d;
      l += 300;
    } else {
      W[l] += d;
      if (((l + 1) % 300 == 0) || l == r) upd(l / 300);
      l++;
    }
}
void add(int x) {
  W[x] = (Cnt[x] == 0 ? W[x] - INF + C[x] : W[x]);
  upd(x / 300);
  add(x, n - 1, -1);
  ++Cnt[x];
}
void del(int x) {
  add(x, n - 1, 1);
  --Cnt[x];
  W[x] = (Cnt[x] == 0 ? W[x] - C[x] + INF : W[x]);
  upd(x / 300);
}
int get() {
  int res = INF;
  for (int i = 0; i < n; i += 300) {
    if (i + 300 - 1 < n)
      res = min(res, M[i / 300] + D[i / 300]);
    else {
      for (int j = (i); j < (n); ++j) res = min(res, W[j] + D[j / 300]);
    }
  }
  return res;
}
int main() {
  scanf("%d %d %d", &n, &m, &h);
  for (int i = (0); i < (m); ++i) {
    scanf("%d", &B[i]);
    BB[i] = B[i];
  }
  for (int i = (0); i < (n); ++i) {
    scanf("%d", &A[i]);
    AA[i] = A[i];
  }
  sort(AA, AA + n);
  sort(BB, BB + m);
  for (int i = (0); i < (n); ++i) {
    int pos = lower_bound(BB, BB + m, h - AA[i]) - BB;
    C[i] = m - pos;
    I[i] = lower_bound(AA, AA + n, A[i]) - AA;
  }
  int res = 0;
  for (int i = (0); i < (n); ++i) {
    W[i] = M[i] = INF;
    D[i] = 0;
  }
  for (int i = (0); i < (m); ++i) add(I[i]);
  for (int i = 0; i + m - 1 < n; i++) {
    int f = get();
    if (f >= 0) ++res;
    del(I[i]);
    if (i + m < n) add(I[i + m]);
  }
  printf("%d\n", res);
  return 0;
}
