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