#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  int safe;
  int bankknotes;
  vector<int> vec;
  cin >> a >> b >> c;
  cin >> safe;
  for (int i = 0; i < safe; i++) {
    cin >> bankknotes;
    if (bankknotes > b && bankknotes < c) vec.push_back(bankknotes);
  }
  cout << vec.size();
  return 0;
}
