#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 5;
int a, b, c;
int n;
int x[N];
int main() {
  int m = 100000 * 100000;
  scanf("%d%d%d", &a, &b, &c);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", x + i);
  sort(x + 1, x + 1 + n);
  int ans = lower_bound(x + 1, x + 1 + n, c) - upper_bound(x + 1, x + 1 + n, b);
  printf("%d\n", max(ans, 0));
  return 0;
}
