#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6;
const int Q = 1e9 + 7;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  vector<int> d(n);
  for (int i = 0; i < n; i++) {
    cin >> d[i];
  }
  sort(d.begin(), d.end());
  int i = 0;
  while (d[i] <= b && i < n) i++;
  int ans = 0;
  while (d[i] < c && i < n) {
    i++;
    ans++;
  }
  cout << ans;
  return 0;
}
