#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, n, kount = 0;
  scanf("%lld", &a);
  scanf("%lld", &b);
  scanf("%lld", &c);
  scanf("%lld", &n);
  for (long long i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    if (x > b && x < c) kount++;
  }
  printf("%lld\n", kount);
  return 0;
}
