#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  map<int, int> m;
  int x;
  while (n--) {
    cin >> x;
    if (m.find(x) == m.end()) {
      m[x] = 1;
    } else {
      m[x]++;
    }
  }
  int ans = 0;
  map<int, int>::iterator it;
  for (it = m.begin(); it != m.end(); it++) {
    if (it->first < c && it->first > b) {
      ans += it->second;
    }
  }
  cout << ans;
}
