#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, d, e, f, m, n, o, p, q, r, s, x, y, z, sum = 0, i, j,
                                                                k, ans = 0;
  cin >> a >> b >> c;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> x;
    if (x > b && x < c) {
      sum++;
    }
  }
  cout << sum << "\n";
}
