#include <bits/stdc++.h>
using namespace std;
int n, a, b, c;
unsigned long long rez;
int main() {
  int i, x;
  cin >> a >> b >> c >> n;
  for (i = 1; i <= n; i++) {
    cin >> x;
    if (b < x && x < c) rez++;
  }
  cout << rez << '\n';
  return 0;
}
