#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 0, b = 0, c = 0, d = 0, f = 0, money = 0;
  cin >> a >> b >> c >> d;
  for (int i = 0; i < d; i++) {
    cin >> f;
    if (f < c && f > b) {
      money += 1;
    }
    f = 0;
  }
  cout << money;
  return 0;
}
