#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  auto result = 0;
  for (auto i = 0; i < n; i++) {
    int x;
    cin >> x;
    result += b < x && x < c;
  }
  cout << result << endl;
}
