#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int a, b, c;
  cin >> a >> b >> c;
  int n;
  cin >> n;
  int ans = 0;
  while (n--) {
    int x;
    cin >> x;
    if (x > b and x < c) ans++;
  }
  cout << ans << "\n";
  return 0;
}
