#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int solve() {
  int n, res = 0;
  scanf("%d", &n);
  if (a <= b || a >= c) return 0;
  while (n--) {
    int x;
    scanf("%d", &x);
    if (x > b && x < c) res++;
  }
  return res;
}
int main() {
  scanf("%d%d%d", &a, &b, &c);
  printf("%d\n", solve());
  return 0;
}
