#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 1;
const int MOD = 1e9 + 7;
class Problem {
 public:
  int N;
  vector<int> v;
  int a, b, c, x, cnt;
  int arr[MAXN + 1];
  void solve(std::istream& input, std::ostream& output);
};
void Problem::solve(std::istream& input, std::ostream& output) {
  input >> a >> b >> c;
  input >> N;
  cnt = 0;
  for (int i = 1; i <= N; i++) {
    cin >> x;
    if (x > b && x < c) cnt++;
  }
  output << cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  std::istream& input(std::cin);
  std::ostream& output(std::cout);
  input.tie(0);
  Problem _a;
  _a.solve(input, output);
  return 0;
}
