#include <bits/stdc++.h>
using namespace std;
int ar[2000000];
int ans[200000];
string asl[1000000][2];
string as[1000000];
int main() {
  long long n, i, j, a, b, c, d, e, f, g, l, h, m, maxx, minn, q;
  string s, t, o, r;
  char ch, ch1;
  double p, y, x, u, z;
  while (cin >> a >> b >> c) {
    cin >> n;
    d = 0;
    for (i = 1; i <= n; i++) {
      cin >> ar[i];
      if (ar[i] > b && ar[i] < c) d++;
    }
    cout << d << endl;
  }
}
