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