#include <bits/stdc++.h>
using namespace std;
int n, a, b, c, x, ans;
int main() {
  cin >> a >> b >> c;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    if (x > b && x < c) ans++;
  }
  cout << ans << endl;
}
