#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int a, b, c, n, ans = 0;
  cin >> a >> b >> c >> n;
  while (n--) {
    int u;
    cin >> u;
    ans += (u > b && u < c);
  }
  cout << ans;
}
