#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-9;
int a, b, c, n, x, ans;
int main() {
  ios::sync_with_stdio(false);
  cin >> a >> b >> c;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x > b && x < c) ans++;
  }
  cout << ans;
  return 0;
}
