#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, n, temp, temp1, count = 0, i;
  cin >> a >> b >> c >> n;
  for (i = 1; i < n + 1; i++) {
    long long int temp;
    cin >> temp;
    if (temp > b && temp < c) count++;
  }
  cout << count << endl;
  return 0;
}
