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