#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, n, x, t = 0;
  cin >> a >> b >> c >> n;
  int arr[n + 2];
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x > b && x < c) t++;
  }
  cout << t << endl;
}
