#include <bits/stdc++.h>
using namespace std;
long long GCDFast(long long a, long long b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
long long GCD(long long b, long long a) {
  if (a == 0) return b;
  return GCD(a, b % a);
}
long long getLCM(long long a, long long b) {
  long long c = a / GCD(a, b);
  return b * c;
}
long long MOD = 1e9 + 7;
long long bigmod(long long b, long long p, long long m) {
  long long ans = 1;
  while (p) {
    if (p & 1) {
      ans *= b;
      ans %= m;
    }
    b = ((b * b) % m);
    p /= 2;
  }
  return ans;
}
long long a[200005], b[100005];
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second > b.second);
}
int main() {
  long long n, i, j, k, temp, p, q;
  long long x, y, z, sum, test_case = 0, ans, test, l, r, m;
  string str;
  bool flag = true;
  ios_base::sync_with_stdio(false);
  long long A, B, C;
  while (cin >> A >> B >> C) {
    cin >> n;
    ans = 0;
    map<long long, int> mymap;
    map<long long, int>::iterator it;
    for (i = 1; i <= n; i++) {
      cin >> x;
      mymap[x]++;
    }
    for (it = mymap.begin(); it != mymap.end(); it++) {
      if (it->first > B && it->first < C) {
        ans += it->second;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
