#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long a, b, c, n, count = 0;
  cin >> a >> b >> c >> n;
  while (n--) {
    long long p;
    cin >> p;
    if (p > b && p < c) {
      count++;
    }
  }
  cout << count;
  return 0;
}
