#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using i64 = long long int;
using ii64 = pair<long long int, long long int>;
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  int n;
  scanf("%d", &n);
  map<int, int> bank;
  for (int i = 0; i < n; i++) {
    int k;
    scanf("%d", &k);
    bank[k]++;
  }
  int res = 0;
  for (auto& safe : bank) {
    if (safe.first > b && safe.first < c) res += safe.second;
  }
  printf("%d", res);
  return 0;
}
