#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int main() {
  int cnt = 0;
  scanf("%d %d %d", &n, &m, &k);
  int x, num;
  scanf("%d", &num);
  for (int i = 0; i < num; i++) {
    scanf("%d", &x);
    if (x > m && x < k) cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
