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