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