#include <bits/stdc++.h>
using namespace std;
int erfen1(int *a, int x, int n) {
  int z = 0, y = n - 1, mid;
  while (z <= y) {
    mid = (z + y) / 2;
    if (a[mid] < x)
      z = mid + 1;
    else
      y = mid - 1;
  }
  return z;
}
int erfen2(int *a, int x, int n) {
  int z = 0, y = n - 1, mid;
  while (z <= y) {
    mid = (z + y) / 2;
    if (a[mid] <= x)
      z = mid + 1;
    else
      y = mid - 1;
  }
  return y;
}
int main() {
  int a, b, c;
  while (~scanf("%d%d%d", &a, &b, &c)) {
    int n;
    scanf("%d", &n);
    int lins[n + 5];
    for (int i = 0; i < n; i++) scanf("%d", &lins[i]);
    sort(lins, lins + n);
    printf("%d\n", erfen1(lins, c, n) - erfen2(lins, b, n) - 1);
  }
  return 0;
}
