#include <bits/stdc++.h>
using namespace std;
void File() {
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
}
void IO() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  IO();
  int n;
  int a, b, c, ans = 0;
  cin >> a >> b >> c >> n;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    if (x > b && x < c) ans++;
  }
  cout << ans << endl;
  return 0;
}
