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