#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long a, b, c;
  cin >> a >> b >> c;
  long long d;
  cin >> d;
  vector<long long> notes(d);
  for (long long i = 0; i < d; i++) cin >> notes[i];
  long long start = b + 1;
  long long en = c - 1;
  long long counter = 0;
  for (long long x : notes) {
    if (x >= start && x <= en) counter++;
  }
  cout << counter << endl;
  return 0;
}
