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