#include <bits/stdc++.h>
using namespace std;
int mult(int x, int y) {
  long long int ans, x1 = (long long int)x, y1 = (long long int)y;
  ans = (x1 * y1) % 1000000007;
  return (int)ans;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
long long int pow1(long long int a, long long int b) {
  long long int ans = 1;
  while (b > 0) {
    if (b & 1) ans = (ans * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return ans;
}
long long int x[100005];
int main() {
  int n, i, j, k;
  long long int a, b, c;
  long long int ans = 0;
  scanf("%lld", &a);
  scanf("%lld", &b);
  scanf("%lld", &c);
  scanf("%d", &n);
  for (i = 1; i < n + 1; i++) {
    scanf("%lld", &x[i]);
    if (x[i] > b && x[i] < c) ans++;
  }
  printf("%lld\n", ans);
  return 0;
}
