#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, counter = 0, n;
  cin >> a >> b >> c >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
    if (vec[i] > b && vec[i] < c) counter++;
  }
  cout << counter;
}
