#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return (a * (b / gcd(a, b))); }
bool getbit(int num, int idx) { return (num >> idx & 1) == 1; }
int setbit(int num, int idx, bool val) {
  if (val == true) return (num | (1 << idx));
  return num & ~(1 << idx);
}
int flipbit(int num, int idx) { return num ^ (1 << idx); }
int cntbits(int mask) {
  int res = 0;
  while (mask) mask &= (mask - 1), res++;
  return res;
}
int arr[(int)1e5 + 10];
int main() {
  std::ios::sync_with_stdio(false), cin.tie(NULL);
  int a, b, c, n, res = 0;
  cin >> a >> b >> c >> n;
  for (int i = 0; i < int(n); ++i) {
    int x;
    cin >> x;
    if (x > b && x < c) res++;
  }
  cout << res << endl;
}
