#include <bits/stdc++.h>
using namespace std;
long long int t, n, a[100005], i, p, q, r, ans;
map<long long int, long long int> m;
set<long long int> s;
int main() {
  cin >> p >> q >> r;
  cin >> n;
  for (long long int i = (long long int)(1); i <= (long long int)(n); i++) {
    cin >> a[i];
    m[a[i]]++;
    s.insert(a[i]);
  }
  ans = 0;
  for (auto it : s)
    if (it > q && it < r) ans += m[it];
  cout << ans;
  return 0;
}
