#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  int cnt = 0;
  while (n--) {
    int pr;
    cin >> pr;
    if ((pr > b && pr < c)) cnt++;
  }
  cout << cnt;
  return 0;
}
