#include <bits/stdc++.h>
using namespace std;
map<int, int> ans;
map<int, int>::iterator it, itt;
int main() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  int n, k;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &k);
    ++ans[k];
  }
  ++ans[b];
  ++ans[c];
  int co = 0;
  it = ans.find(b);
  itt = ans.find(c);
  for (++it; it != itt; ++it) co += it->second;
  printf("%d\n", co);
  return 0;
}
