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