#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, n, x, ca = 0;
  cin >> a >> b >> c >> n;
  while (n--) {
    cin >> x;
    if (x > b && c > x) {
      ca++;
    }
  }
  cout << ca << endl;
  return 0;
}
