#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000000LL;
int main() {
  cin.sync_with_stdio(false);
  int a, b, c;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  int res = 0;
  while (n--) {
    int x;
    cin >> x;
    if (b < x && x < c) res++;
  }
  cout << res << endl;
  return 0;
}
