#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, a = 0, b = 0, c = 0;
  cin >> a >> b >> c;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int temp = 0;
    cin >> temp;
    if (mp.count(temp)) {
      mp[temp]++;
    } else
      mp[temp] = 1;
  }
  int _min = b + 1, _max = c - 1, res = 0;
  map<int, int>::iterator itr = mp.begin();
  for (; itr != mp.end(); itr++) {
    if (itr->first >= _min && itr->first <= _max) {
      res += itr->second;
    }
  }
  cout << res << endl;
  return 0;
}
