#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, n, t, r = 0;
  cin >> a >> b >> c >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (t > b && t < c) r++;
  }
  cout << r << endl;
}
