#include <bits/stdc++.h>
using namespace std;
const int M = 200000 + 5;
int a[M];
int b[M];
int c[M];
struct TREE {
  int l;
  int r;
  int minv;
  int s;
  int x;
} tree[4 * M];
void build(int l, int r, int node) {
  tree[node].l = l;
  tree[node].r = r;
  tree[node].x = 0;
  if (l == r) {
    tree[node].minv = c[l];
    tree[node].s = c[l];
    return;
  } else {
    int m = (l + r) / 2;
    build(l, m, node * 2);
    build(m + 1, r, node * 2 + 1);
    tree[node].s = tree[node * 2].s + tree[node * 2 + 1].s;
    tree[node].minv = min(tree[node * 2].minv, tree[node * 2 + 1].minv);
  }
}
void pushDown(int node) {
  if (tree[node].x != 0) {
    int x = tree[node].x;
    int m = (tree[node].l + tree[node].r) / 2;
    int l = tree[node].l;
    int r = tree[node].r;
    tree[node * 2].x = tree[node * 2].x + x;
    tree[node * 2].s = tree[node * 2].s + (m - l + 1) * x;
    tree[node * 2].minv = tree[node * 2].minv + x;
    tree[node * 2 + 1].x = tree[node * 2 + 1].x + x;
    tree[node * 2 + 1].s = tree[node * 2 + 1].s + (r - m) * x;
    tree[node * 2 + 1].minv = tree[node * 2 + 1].minv + x;
    tree[node].x = 0;
  }
}
void update(int l, int r, int node, int val) {
  if (l <= tree[node].l && tree[node].r <= r) {
    tree[node].x += val;
    tree[node].s = tree[node].s + (tree[node].r - tree[node].l + 1) * val;
    tree[node].minv = tree[node].minv + val;
  } else {
    int m = (tree[node].l + tree[node].r) / 2;
    pushDown(node);
    if (r <= m) {
      update(l, r, node * 2, val);
    } else {
      if (l >= m + 1) {
        update(l, r, node * 2 + 1, val);
      } else {
        update(l, m, node * 2, val);
        update(m + 1, r, node * 2 + 1, val);
      }
    }
    tree[node].s = tree[node * 2].s + tree[node * 2 + 1].s;
    tree[node].minv = min(tree[node * 2].minv, tree[node * 2 + 1].minv);
  }
}
int qs(int l, int r, int node) {
  if (l <= tree[node].l && tree[node].r <= r) {
    return tree[node].s;
  } else {
    int m = (tree[node].l + tree[node].r) / 2;
    pushDown(node);
    if (r <= m) {
      return qs(l, r, node * 2);
    } else {
      if (l >= m + 1) {
        return qs(l, r, node * 2 + 1);
      } else {
        int s1 = qs(l, m, node * 2);
        int s2 = qs(m + 1, r, node * 2 + 1);
        return s1 + s2;
      }
    }
  }
}
int qminv(int l, int r, int node) {
  if (l <= tree[node].l && tree[node].r <= r) {
    return tree[node].minv;
  } else {
    int m = (tree[node].l + tree[node].r) / 2;
    pushDown(node);
    if (r <= m) {
      return qminv(l, r, node * 2);
    } else {
      if (l >= m + 1) {
        return qminv(l, r, node * 2 + 1);
      } else {
        int min1 = qminv(l, m, node * 2);
        int min2 = qminv(m + 1, r, node * 2 + 1);
        return min(min1, min2);
      }
    }
  }
}
int main() {
  time_t t_start, t_end;
  t_start = clock();
  int n, m, h;
  cin >> n >> m >> h;
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
  }
  sort(b + 1, b + m + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= m; i++) {
    c[i] = m - i + 1;
  }
  build(1, m, 1);
  for (int i = 1; i <= m; i++) {
    int idx = lower_bound(b + 1, b + m + 1, h - a[i]) - b;
    if (idx <= m) {
      update(1, idx, 1, -1);
    } else {
      ;
    }
  }
  int minv = qminv(1, m, 1);
  int s = qs(1, 1, 1);
  int ans = 0;
  if (minv >= 0 && s == 0) {
    ans = 1;
  }
  for (int i = m + 1; i <= n; i++) {
    int idx = lower_bound(b + 1, b + m + 1, h - a[i]) - b;
    if (idx <= m) {
      update(1, idx, 1, -1);
    } else {
      ;
    }
    int j = i - m;
    int jdx = lower_bound(b + 1, b + m + 1, h - a[j]) - b;
    if (jdx <= m) {
      update(1, jdx, 1, 1);
    }
    minv = qminv(1, m, 1);
    s = qs(1, 1, 1);
    if (minv >= 0 && s == 0) {
      ans++;
    }
  }
  cout << ans << endl;
  t_end = clock();
  return 0;
}
