#include <bits/stdc++.h>
int main() {
  int a, b, c, n, i, k, cc = 0;
  scanf("%d%d%d", &a, &b, &c);
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &k);
    if (k > b && k < c) cc++;
  }
  printf("%d\n", cc);
  return 0;
}
