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