#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const double eps = 1e-8;
const int inf = 1e9 + 7;
int a, b, c;
int n;
int x[maxn];
int main() {
  cin >> a >> b >> c >> n;
  int s = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    if (x[i] > b && x[i] < c) s++;
  }
  cout << s << endl;
}
