#include <bits/stdc++.h>
using namespace std;
template <typename T>
void sci(T& t) {
  cin >> t;
}
template <typename T, typename... Ts>
void sci(T& t, Ts&... ts) {
  sci(t);
  sci(ts...);
}
int32_t main() {
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int64_t a, b, c;
  cin >> a >> b >> c;
  int64_t n;
  sci(n);
  vector<int64_t> first(n);
  int64_t ans = 0;
  for (int64_t(i) = 0; (i) < (int64_t)(n); ++(i)) {
    cin >> first[i];
    if (b < first[i] && first[i] < c) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
