#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int a, b, c, cnt = 0;
  scanf("%d%d%d", &a, &b, &c);
  int n = 0;
  scanf("%d", &n);
  int k[n + 1];
  for (int i = 0; i < n; i++) {
    scanf("%d", &k[i]);
    if (k[i] > b && k[i] < c) cnt++;
  }
  cout << cnt;
  return 0;
}
