#include <bits/stdc++.h>
using namespace std;
string input = "input.txt";
string output = "output.txt";
int main() {
  int b, a, c;
  cin >> b >> a >> c;
  int n;
  cin >> n;
  int ans = 0;
  int t;
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (t > a && t < c) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
