#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int a, b, c, n;
  cin >> a >> b >> c >> n;
  int res = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if ((x <= a && x > b) || (x > a && x < c)) {
      res++;
    }
  }
  cout << res << endl;
  return 0;
}
