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