#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc, i, j, k;
  int a, b, c;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  vector<int> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  sort((v).begin(), (v).end());
  int mx = 0;
  for (i = 0; i < n; i++) {
    if (b < a and c > a) {
      if (v[i] > b and v[i] < c) mx++;
      continue;
    }
    if (b > a) {
      if (v[i] < b) mx++;
      continue;
    }
    if (a > c) {
      if (v[i] > c) mx++;
      continue;
    }
  }
  cout << mx;
  return 0;
}
