#include <bits/stdc++.h>
using namespace std;
struct user {
  string name;
  int next;
};
bool isVoyle(char c) {
  string v = "aeiouy";
  for (int index = 0; index < 6; index++)
    if (c == v[index]) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  int a, b, c;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  int ans = 0;
  for (int index = 0; index < n; index++) {
    int nbr;
    cin >> nbr;
    if (nbr > b && nbr < c) ans++;
  }
  cout << ans << endl;
  return 0;
}
