#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
int A[100005];
long long ans;
int main() {
  int a, b, n, c, x;
  cin >> a >> b >> c;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
    m[A[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (A[i] > b && A[i] < c) {
      ans += m[A[i]];
      m[A[i]] = 0;
    }
  }
  cout << ans;
}
