#include <bits/stdc++.h>
using namespace std;
const int N = 150005;
int a[N], b[N];
struct P {
  int l, r, mid, key, add;
} arr[4 * N];
void build(int L, int R, int c) {
  arr[c].l = L;
  arr[c].r = R;
  arr[c].mid = (L + R) / 2;
  if (L == R) {
    arr[c].key = -L;
    return;
  }
  build(L, arr[c].mid, c + c);
  build(arr[c].mid + 1, R, c + c + 1);
  arr[c].key = ((arr[c + c].key) < (arr[c + c + 1].key) ? (arr[c + c].key)
                                                        : (arr[c + c + 1].key));
}
void down(int c) {
  if (arr[c].add) {
    arr[c + c].add += arr[c].add;
    arr[c + c + 1].add += arr[c].add;
    arr[c].add = 0;
  }
}
void insert(int x, int v, int c) {
  if (x <= arr[c].l) {
    arr[c].add += v;
    return;
  }
  down(c);
  if (x <= arr[c].mid) insert(x, v, c + c);
  insert(x, v, c + c + 1);
  arr[c].key = ((arr[c + c].key + arr[c + c].add) <
                        (arr[c + c + 1].key + arr[c + c + 1].add)
                    ? (arr[c + c].key + arr[c + c].add)
                    : (arr[c + c + 1].key + arr[c + c + 1].add));
}
int main() {
  int n, m, h, i;
  scanf("%d%d%d", &n, &m, &h);
  for (i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
  }
  sort(b + 1, b + m + 1);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  build(1, m, 1);
  for (i = 1; i < m; i++) {
    int p = lower_bound(b + 1, b + m + 1, h - a[i]) - b;
    if (p <= m) insert(p, 1, 1);
  }
  int ret = 0;
  for (; i <= n; i++) {
    int p;
    if (i > m) {
      p = lower_bound(b + 1, b + m + 1, h - a[i - m]) - b;
      if (p <= m) insert(p, -1, 1);
    }
    p = lower_bound(b + 1, b + m + 1, h - a[i]) - b;
    if (p <= m) insert(p, 1, 1);
    if (arr[1].key + arr[1].add >= 0) ret++;
  }
  printf("%d\n", ret);
  return 0;
}
