#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  fast();
  int n, x = 0, k, l, a, b, c, j;
  cin >> a >> b >> c >> n;
  int d[n], i;
  for (i = 0; i < n; i++) cin >> d[i];
  sort(d, d + n);
  for (i = 0; i < n; i++) {
    if (d[i] > b)
      while (d[i] > b && d[i] < c) {
        x++;
        i++;
      }
    if (x) break;
  }
  cout << x << endl;
}
