#include <bits/stdc++.h>
using namespace std;
const long long PR = 1000000009;
int main() {
  ios::sync_with_stdio(false);
  int a, b, c;
  int ans = 0, n;
  cin >> a >> b >> c;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int k;
    cin >> k;
    if (k > b && k < c) ans++;
  }
  cout << ans << '\n';
  return 0;
};
