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