#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, arr[100000], l, m, n, x, coun, sum, ans, T, check;
  char str[100000];
  string s;
  vector<long long> v;
  ios_base::sync_with_stdio(0);
  long long a, b, c;
  cin >> a >> b >> c;
  ans = 0;
  map<long long, long long> mp;
  map<long long, long long>::iterator it;
  cin >> n;
  for (i = (1); i < (n + 1); i++) {
    cin >> x;
    mp[x]++;
  }
  for (it = mp.begin(); it != mp.end(); it++) {
    x = it->first;
    if (x > b && x < c) {
      x = it->second;
      ans += x;
    }
  }
  cout << ans << endl;
  return 0;
}
