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