#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 6.66;
map<int, int> A;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int a, b, c;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    A[x]++;
  }
  int ans = 0;
  for (auto x : A)
    if (x.first > b && x.first < c) ans += x.second;
  cout << ans << endl;
  return 0;
}
