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