#include <bits/stdc++.h>
using namespace std;
int main() {
  int positions, guard1, guard2, sum = 0, number;
  cin >> positions >> guard1 >> guard2 >> number;
  for (int c = 0, a; c < number; c++) {
    cin >> a;
    sum += (guard1 < a && a < guard2);
  }
  cout << sum;
}
