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