#include <bits/stdc++.h>
int main() {
  int n1, n2, n3, n4, n5, n6 = 0;
  std::cin >> n1 >> n2 >> n3 >> n4;
  for (int i = 0; i < n4; i++) {
    std::cin >> n5;
    if (n5 > n2 && n5 < n3 && n1 > n2 && n1 < n3) n6++;
  }
  std::cout << n6;
}
