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