#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int a, b, c;
  cin >> a >> b >> c;
  map<int, int> cs;
  cs[b] = 0;
  cs[a] = 0;
  cs[c] = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    cs[t]++;
  }
  map<int, int>::iterator it = cs.find(b);
  int ans = 0;
  it++;
  for (it; it != cs.find(c); it++) {
    ans += (it->second);
  }
  cout << ans << endl;
  return 0;
}
