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