#include <bits/stdc++.h>
int main() {
  int a, b, c;
  std::cin >> a >> b >> c;
  int n;
  std::cin >> n;
  int sum = 0;
  for (int i = 1; i <= n; ++i) {
    int x;
    std::cin >> x;
    if (x > b && x < c) {
      ++sum;
    }
  }
  std::cout << sum;
}
