#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  long long s = 0;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (x > b and x < c) s++;
  }
  cout << s;
  return 0;
}
