#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> arr;
set<long long int> came;
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(0);
  ;
  long long int i, j, n, x, y, f = 0, ans = 0, a, b, c;
  char ch;
  string s;
  cin >> a >> b >> c;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> x;
    arr[x]++;
    came.insert(x);
  }
  for (auto it : came) {
    if (it >= b + 1 && it <= c - 1) ans += arr[it];
  }
  cout << ans;
  return 0;
}
