#include <bits/stdc++.h>
using namespace std;
long long t, m, sp, junger, mid, top, bot, x, y;
long long n = 0, k = 0;
long long test;
long long a, b, c;
int main() {
  cin >> a >> b >> c;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    scanf("%I64d", &k);
    if (k > b && k < c) t++;
  }
  cout << t;
}
