A robber has attempted to rob a bank but failed to complete his task. However, he had managed to open all the safes.

Oleg the bank client loves money (who doesn't), and decides to take advantage of this failed robbery and steal some money from the safes. There are many safes arranged in a line, where the i-th safe from the left is called safe i. There are n banknotes left in all the safes in total. The i-th banknote is in safe x_{i}. Oleg is now at safe a. There are two security guards, one of which guards the safe b such that b < a, i.e. the first guard is to the left of Oleg. The other guard guards the safe c so that c > a, i.e. he is to the right of Oleg.

The two guards are very lazy, so they do not move. In every second, Oleg can either take all the banknotes from the current safe or move to any of the neighboring safes. However, he cannot visit any safe that is guarded by security guards at any time, becaues he might be charged for stealing. Determine the maximum amount of banknotes Oleg can gather.


-----Input-----

The first line of input contains three space-separated integers, a, b and c (1 ≤ b < a < c ≤ 10^9), denoting the positions of Oleg, the first security guard and the second security guard, respectively.

The next line of input contains a single integer n (1 ≤ n ≤ 10^5), denoting the number of banknotes.

The next line of input contains n space-separated integers x_1, x_2, ..., x_{n} (1 ≤ x_{i} ≤ 10^9), denoting that the i-th banknote is located in the x_{i}-th safe. Note that x_{i} are not guaranteed to be distinct.


-----Output-----

Output a single integer: the maximum number of banknotes Oleg can take.


-----Examples-----
Input
5 3 7
8
4 7 5 5 3 6 2 8

Output
4

Input
6 5 7
5
1 5 7 92 3

Output
0



-----Note-----

In the first example Oleg can take the banknotes in positions 4, 5, 6 (note that there are 2 banknotes at position 5). Oleg can't take the banknotes in safes 7 and 8 because he can't run into the second security guard. Similarly, Oleg cannot take the banknotes at positions 3 and 2 because he can't run into the first security guard. Thus, he can take a maximum of 4 banknotes.

For the second sample, Oleg can't take any banknotes without bumping into any of the security guards.

Source: codeforces | Difficulty: EASY
Tags: Implementation

Complete search


Solutions:
(a, b, c) = map(int, input().split())
n = int(input())
l = list(map(int, input().split()))
count = 0
for i in l:
	if i > b and i < c:
		count = count + 1
print(count)


(a, b, c) = map(int, input().split())
n = int(input())
k = 0
for x in map(int, input().split()):
	if b < x < c:
		k += 1
print(k)


(a, b, c) = input().split(' ')
(a, b, c) = (int(a), int(b), int(c))
input()
safes = range(b + 1, c)
line3 = input().split(' ')
c = 0
for sf in line3:
	if int(sf) in safes:
		c += 1
print(c)


(A, B, C) = list(map(int, input().split()))
X = int(input())
print(sum((B < x < C for x in map(int, input().split()))))


(a, b, c) = map(int, input().split())
n = int(input())
ans = 0
for i in input().split():
	i = int(i)
	if i > b and i < c:
		ans += 1
print(ans)


def main():
	(a, b, c) = map(int, input().split())
	n = int(input())
	money = map(int, input().split())
	ans = 0
	for x in money:
		if b < x < c:
			ans += 1
	print(ans)
main()


import sys
import os
import math
import re
(a, b, c) = map(int, input().split())
n = int(input())
l = list(map(int, input().split()))
total = 0
for note in l:
	if note > b and note < c:
		total += 1
print(total)


(a, b, c) = map(int, input().split())
n = int(input())
z = [int(x) for x in input().split()]
ans = 0
for x in z:
	if b < x < c:
		ans += 1
print(ans)


(a, b, c) = list(map(int, input().split()))
n = int(input())
ans = 0
L = list(map(int, input().split()))
for i in L:
	if b < i < c:
		ans += 1
print(ans)


a = [int(q) for q in input().strip().split()]
n = int(input())
b = [int(q) for q in input().strip().split()]
t = 0
k = 0
while k < len(b):
	if b[k] > a[1] and b[k] < a[2]:
		t += 1
	k += 1
print(t)


(a, b, c) = map(int, input().strip().split())
n = int(input().strip())
cnt = 0
cifre = list(map(int, input().strip().split()))
for e in cifre:
	if b < e < c:
		cnt += 1
print(cnt)


(a, b, c) = map(int, input().split())
n = int(input())
p = list(map(int, input().split()))
sm = 0
for i in range(len(p)):
	if p[i] > b and p[i] < c:
		sm += 1
print(sm)


(a, b, c) = map(int, input().split(' '))
n = int(input())
l = list(map(int, input().split(' ')))
res = 0
for x in l:
	if x > b and x < c:
		res += 1
print(res)


arr = input().split()
a = int(arr[1])
b = int(arr[2])
n = input()
n = int(n)
i = 0
res = 0
arr = input().split()
while i < n:
	cur = int(arr[i])
	if cur > a and cur < b:
		res += 1
	i += 1
print(res)


__author__ = 'Alexander'

def Task(inp1, inp2, inp3):
	(a, b, c) = map(int, inp1.split())
	n = int(inp2)
	if a < b:
		c = b
		b = -1
	if a > c:
		b = c
		c = 10 ** 9 + 1
	elems = [int(elem) for elem in inp3.split() if int(elem) < c and int(elem) > b]
	res = [len(elems)]
	return res

def Main():
	inp1 = input()
	inp2 = input()
	inp3 = input()
	outp = Task(inp1, inp2, inp3)
	print('{}'.format(outp[0]))

def Test():
	assert Task('5 3 7', '8', '4 7 5 5 3 6 2 8') == [4]
	assert Task('6 5 7', '5', '1 5 7 92 3') == [0]
	assert Task('3 5 7', '5', '1 5 7 92 3') == [2]
Main()


(a, b, c) = map(int, input().split())
gp = sorted([b, c])
_ = input()
bn = list(map(int, input().split()))
if a < gp[0]:
	bn = [item for item in bn if item < gp[0]]
elif a > gp[1]:
	bn = [item for item in bn if item > gp[1]]
else:
	bn = [item for item in bn if item < gp[1] and item > gp[0]]
print(len(bn))


(a, b, c) = [int(i) for i in input().split()]
n = int(input())
banknotes = list()
banknotes = [int(i) for i in input().split()]
bank = banknotes[b:c - 1]
ans = 0
for i in banknotes:
	if i > b and i < c:
		ans += 1
print(ans)


f = lambda : map(int, input().split())
(o, g1, g2) = f()
n = int(input())
nt = list(f())
c = 0
for i in nt:
	if g1 < i < g2:
		c += 1
print(c)


(a, b, c) = map(int, input().split())
n = int(input())
xx = list(map(int, input().split()))
ans = sum((1 for x in xx if b < x and x < c))
print(ans)


(a, b, c) = map(int, input().split())
n = int(input())
x = list(map(int, input().split()))
result = 0
for i in x:
	if b < i < c:
		result += 1
print(result)


s = list(map(int, input().split()))
n = int(input())
e = list(map(int, input().split()))
a = 0
for i in range(0, len(e)):
	if e[i] > min(s) and e[i] < max(s):
		a += 1
print(a)


s = input()
p = s.split()
a = int(p[0])
b = int(p[1])
c = int(p[2])
f = input()
ans = []
notes = [int(i) for i in input().split()]
for i in notes:
	i = int(i)
	if i > b and i < c:
		ans.append(i)
print(len(ans))


(a, b, c) = map(int, input().split())
input()
all_cells = map(int, input().split())
cells = [x for x in all_cells if b < x < c]
print(len(cells))


import sys

def solve():
	(a, b, c) = map(int, input().split())
	n = int(input())
	x = [int(i) for i in input().split()]
	ans = 0
	for xi in x:
		if b < xi < c:
			ans += 1
	print(ans)
solve()


(n, a, b) = [int(x) for x in input().split()]
number = int(input())
notes = [int(x) for x in input().split()]
answer = 0
for i in range(len(notes)):
	if a < notes[i] < b:
		answer += 1
print(answer)


(a, b, c) = map(int, input().split())
n = int(input())
d = list(map(int, input().split()))
f = 0
for i in d:
	if i > b and i < c:
		f += 1
print(f)


import sys

def main():
	(a, b, c) = list(map(int, sys.stdin.readline().split()))
	n = int(sys.stdin.readline().rstrip())
	x = list(map(int, sys.stdin.readline().split()))
	result = sum((1 for i in range(n) if b + 1 <= x[i] <= c - 1))
	sys.stdout.write(str(result) + '\n')
main()


(a, b, c) = map(int, input().split())
input()
print(sum([1 for i in map(int, input().split()) if b < i < c]))


(a, b, c) = map(int, input().split())
n = int(input())
l = [int(x) for x in input().split()]
j = 0
for i in l:
	if b < i < c:
		j += 1
print(j)


(a, b, c) = map(int, input().split(' '))
cnt = 0
n = int(input())
x = list(map(int, input().split(' ')))
for i in range(n):
	if x[i] < c and x[i] > b:
		cnt += 1
print(cnt)


(a, b, c) = map(int, input().split())
n = int(input())
xi = list(map(int, input().split()))
ans = 0
for i in range(n):
	ans += xi[i] < c and xi[i] > b
print(ans)


L = input()
L = L.split()
a = int(L[0])
b = int(L[1])
c = int(L[2])
n = int(input())
bill = input()
bill = bill.split()
for k in range(n):
	bill[k] = int(bill[k])
mini = b
maxi = c
count = 0
for k in range(n):
	if bill[k] > mini and bill[k] < maxi:
		count += 1
print(count)


(a, b, c) = map(int, input().split())
n = int(input())
l = list(map(int, input().split()))
print(len(list(filter(lambda x: x in range(b + 1, c), l))))


(x, y, z) = map(int, input().split())
n = int(input())
print(len(list(filter(lambda x: y < int(x) and z > int(x), input().split()))))


(a, b, c) = map(int, input().split())
n = int(input())
x = list(map(int, input().split()))
k = []
for i in range(n):
	if x[i] > b and x[i] < c:
		k.append(x[i])
print(len(k))


(a, b, c) = map(int, input().split())
input()
a = 0
A = list(map(int, input().split()))
for i in A:
	if i > b and i < c:
		a += 1
print(a)


i = lambda : map(int, input().split())
(a, b, c) = i()
i()
print(sum((b < x < c for x in i())))


z = [int(s) for s in input().split()]
(a, b, c) = (z[0], z[1], z[2])
n = int(input())
z = [int(s) for s in input().split()]
k = 0
for i in range(len(z)):
	if b < z[i] and z[i] < c:
		k += 1
print(k)


def convert_inp_to_int():
	return [int(x) for x in input().strip().split()]

def get_position(flag, n, notes_at, pos):
	if flag:
		i = 0
		while i < n:
			if notes_at[i] > pos:
				return i - 1
			i += 1
		return i - 1
	else:
		i = 0
		while i < n:
			if notes_at[i] >= pos:
				return i - 1
			i += 1
		return i - 1
abc = convert_inp_to_int()
a = abc[0]
b = abc[1]
c = abc[2]
n = convert_inp_to_int()[0]
notes_at = convert_inp_to_int()
notes_at.sort()
g1_pos = get_position(1, n, notes_at, b)
g2_pos = get_position(0, n, notes_at, c)
g1_pos += 1
print(g2_pos - g1_pos + 1)


(a, b, c) = (int(i) for i in input().split())
n = int(input())
counter = 0
for i in input().split():
	if int(i) > b and int(i) < c:
		counter += 1
print(counter)


(_, b, c) = map(int, input().split())
input()
print(sum((b < x < c for x in map(int, input().split()))))


(a, b, c) = map(int, input().split())
n = int(input())
notes = [int(x) for x in input().split()]
print(len(list(filter(lambda x: x < c and x > b, notes))))


(a, b, c) = map(int, input().split())
n = int(input())
notes = list(map(int, input().split()))
res = 0
for i in notes:
	if b < i and i < c:
		res += 1
print(res)


from collections import Counter
abc = list(map(int, input().split()))
a = abc[0]
b = abc[1]
c = abc[2]
n = int(input())
nums = list(map(int, input().split()))
cnt = dict(Counter(nums))
sorted_cnt = sorted(cnt.items(), key=lambda x: x[0])
filtered = []
for val in sorted_cnt:
	if val[0] > b and val[0] < c:
		filtered.append(val)
res = 0
for val in filtered:
	res += val[1]
print(res)


(a, b, c) = [int(s) for s in input().split(' ')]
n = int(input())
notes = [int(s) for s in input().split(' ')]
answer = len([note for note in notes if b < note < c])
print(answer)


(a, b, c) = list(map(int, input().split()))
n = int(input())
xs = list(map(int, input().split()))
cnt = 0
for x in xs:
	cnt += int(b < x and x < c)
print(cnt)


(a, b, c) = map(int, input().split())
input()
n = list(map(int, input().split()))
counter = 0
for i in n:
	if b < i < c:
		counter += 1
print(counter)


(a, b, c) = map(int, input().split())
n = int(input())
k = list(map(int, input().split()))
s = 0
for i in k:
	if b < i < c:
		s += 1
print(s)


(a, b, c) = map(int, input().split())
n = int(input())
A = list(map(int, input().split()))
num = 0
for i in range(n):
	if b < A[i] < c:
		num += 1
print(num)


pos = input().split()
ol = int(pos[0])
gleft = int(pos[1])
gright = int(pos[2])
n = int(input())
result = 0
bnks = list(map(int, input().split()))
for i in bnks:
	if i > gleft and i < gright:
		result += 1
print(result)


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

def solve():
	(c, a, b) = read_ints()
	n = read_int()
	A = read_ints()
	count = 0
	for x in A:
		if a < x < b:
			count += 1
	print(count)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def fib_to_n(n):
	f = []
	(a, b) = (0, 1)
	while a <= n:
		f.append(a)
		(a, b) = (b, a + b)
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P

def is_lucky(n):
	return set(list(str(n))).issubset({'4', '7'})
main()


(o, g1, g2) = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
c = 0
for i in a:
	if i in range(g1 + 1, g2):
		c += 1
print(c)


z = input().split()
a = int(z[0])
b = int(z[1])
c = int(z[2])
n = int(input())
l = list(map(int, input().split()))
res = 0
for item in l:
	if item > b and item < c:
		res += 1
print(res)


(n, m, o) = map(int, input().split())
a = int(input())
b = sorted(list(map(int, input().split())))
z = 0
for i in b:
	if i > m and i < o:
		z += 1
print(z)


(n, a, b) = map(int, input().split())
_ = input()
arr = map(int, input().split())
count = 0
for x in arr:
	if a < x < b:
		count += 1
print(count)


t = list(map(int, input().split()))
a = int(input())
p = list(map(int, input().split()))
f = 0
for j in p:
	if j > t[1] and j < t[2]:
		f += 1
print(f)


(a, b, c) = map(int, input().split())
n = int(input())
xs = map(int, input().split())
count = 0
for x in xs:
	if b < x < c:
		count += 1
print(count)


read = lambda : map(int, input().split())
(a, b, c) = read()
n = int(input())
x = list(read())
ans = sum((b < i < c for i in x))
print(ans)


n = [int(x) for x in input().split()]
num = int(input())
acc = [int(x) for x in input().split()]
count = 0
for i in acc:
	if n[1] < i and n[2] > i:
		count += 1
print(count)


(a, b, c) = map(int, input().split())
n = int(input())
res = 0
for i in map(int, input().split()):
	res += b < i < c
print(res)


(a, b, c) = map(int, input().split())
n = int(input())
count = 0
notes = list(map(int, input().split()))
for note in notes:
	if note > b and note < c:
		count += 1
print(count)


ans = 0
inp1 = input().split(' ')
inp2 = int(input())
inp3 = input().split(' ')
man = int(inp1[0])
l = int(inp1[1])
r = int(inp1[2])
if man < l:
	r = l - 1
	l = 1
elif man > r:
	l = r + 1
	r = 10 ** 9 + 1
for num in inp3:
	num = int(num)
	if num > l and num < r:
		ans = ans + 1
print(ans)


import bisect
(a, b, c) = map(int, input().split())
input()
x = list(sorted(map(int, input().split())))
left = bisect.bisect_right(x, b)
right = bisect.bisect_left(x, c)
print(right - left)


def main_function():
	(a, b, c) = [int(i) for i in input().split(' ')]
	n = int(input())
	x = [int(i) for i in input().split(' ')]
	banknotes = 0
	for i in x:
		if i > b and i < c:
			banknotes += 1
	return str(banknotes)
print(main_function())


(z, x, y) = map(int, input().split())
n = int(input())
tot = 0
l = list(map(int, input().split()))
for i in l:
	if i < y and i > x:
		tot += 1
print(tot)


(a, b, c) = [int(x) for x in input().split()]
n = int(input())
li = [int(x) for x in input().split()]
ans = 0
for i in li:
	ans += 1 if i > b and i < c else 0
print(ans)


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
ABCD = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
months = {1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, a, b) = map(int, input().split(' '))
t = int(input())
l = list(map(int, input().split(' ')))
l.sort()
ans = 0
for i in range(t):
	if a < l[i] < b:
		ans += 1
print(ans)


(a, b, c) = map(int, input().split())
n = int(input())
ans = 0
money = list(map(int, input().split()))
for i in range(n):
	cur = money[i]
	if cur > b and cur < c:
		ans = ans + 1
print(ans)


(a, b, c) = map(int, input().split())
x = int(input())
a1 = list(map(int, input().split()))
t = 0
for i in range(len(a1)):
	if a1[i] > b and a1[i] < c:
		t = t + 1
print(t)


(a, b, c) = map(int, input().split())
n = int(input())
print(sum((1 for x in input().split() if int(x) in range(b + 1, c))))


(a, b, c) = list(map(int, input().split()))
n = int(input())
banks = list(map(int, input().split()))
ans = 0
for bank in banks:
	if b < bank < c:
		ans += 1
print(ans)


(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
n = int(input())
cupury = [int(x) for x in input().split()]
num_of_cup = 0
for cup in cupury:
	if cup < c and cup > b:
		num_of_cup += 1
print(num_of_cup)


(a, b, c) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
n = int(input())
array = [int(x) for x in input().split(' ')]
counter = 0
for i in range(n):
	if array[i] < c and array[i] > b:
		counter += 1
print(counter)


(p, l, r) = map(int, input().split())
input()
print(sum((l < v < r for v in map(int, input().split()))))


(o, a, b) = map(int, input().split())
n = int(input())
l = [i for i in input().split() if int(i) > a and int(i) < b]
print(len(l))


(a, b, c) = map(int, input().split())
n = int(input())
m = map(int, input().split())
ans = len([i for i in m if i > b and i < c])
print(ans)


(A, B, C) = map(int, input().split())
N = int(input())
print(len(list(filter(lambda n: B < int(n) and int(n) < C, input().split()))))


a = input()
b = input()
c = input()
x = [int(i) for i in c.split()]
y = [int(i) for i in a.split()]
count = 0
for i in x:
	if i > y[1] and i < y[2]:
		count = count + 1
print(count)


(a, b, c) = map(int, input().split())
n = int(input())
s = list(map(int, input().split()))
col = 0
for i in range(n):
	if s[i] > b and s[i] < c:
		col += 1
print(col)


(x, y, z) = map(int, input().split())
a = int(input())
print(sum((y < a < z for a in map(int, input().split()))))


from sys import stdin, stdout

def rint():
	return map(int, stdin.readline().split())
(a, b, c) = rint()
n = int(input())
x = list(rint())
ans = 0
for i in x:
	if i > b and i < c:
		ans += 1
print(ans)


(a, b, c) = map(int, input().split())
n = int(input())
x = list(map(int, input().split()))
print(sum((1 for el in x if b < el < c)))


import sys

def main():
	(_, b, c, _, *l) = map(int, sys.stdin.read().strip().split())
	return sum((b < i < c for i in l))
print(main())


def main():
	string = input().split(' ')
	a = int(string[0])
	b = int(string[1])
	c = int(string[2])
	del string
	n = int(input())
	x = input().split(' ')
	count = 0
	for i in range(n):
		x[i] = int(x[i])
		if x[i] > b and x[i] < c:
			count += 1
	print(count)
main()


(a, b, c) = map(int, input().split())
N = int(input())
ans = 0
L = list(map(int, input().split()))
for i in range(N):
	if L[i] > b and L[i] < c:
		ans += 1
print(ans)


(o, g1, g2) = map(int, input().split())
n = int(input())
banks = input().split()
count = 0
for i in range(n):
	if int(banks[i]) <= g1:
		pass
	elif int(banks[i]) >= g2:
		pass
	elif o != g1 and o != g2:
		count += 1
print(count)


from sys import stdin

def BufReader():
	while True:
		for c in stdin.read(9000):
			yield c
inp_buf = BufReader()

def nextInt():
	l = []
	while True:
		c = next(inp_buf)
		if c in (' ', '\n'):
			if l:
				break
			else:
				continue
		l.append(c)
	return int(''.join(l))
(a, b, c) = [nextInt() for _ in range(3)]
(n, cnt) = (nextInt(), 0)
for _ in range(n):
	if b < nextInt() < c:
		cnt += 1
print(cnt)


(a, b, c) = map(int, input().split())
n = int(input())
ans = 0
for ind in input().split():
	if b < int(ind) < c:
		ans += 1
print(ans)


(a, b, c) = map(int, input().split())
n = int(input())
p = list(map(int, input().split()))
x = dict()
for i in p:
	if str(i) in x:
		x[str(i)] += 1
	else:
		x[str(i)] = 1
res = 0
for i in x.items():
	if b < int(i[0]) < c:
		res += i[1]
print(res)


from bisect import bisect_left, bisect_right

def num_notes(x, left, right):
	count = 0
	for i in range(left, right + 1):
		count += 1
	return count

def search_left(a, x, lo=0):
	if x < a[0]:
		return 0
	hi = len(a)
	pos = bisect_left(a, x, lo, hi)
	return pos

def search_right(a, x, lo=0):
	if x > a[len(a) - 1]:
		return len(a) - 1
	hi = len(a)
	pos = bisect_right(a, x, lo, hi) - 1
	return pos if a[pos] < x else bisect_right(a, x - 1, lo, hi) - 1
(a, b, c) = [int(num) for num in input().split()]
n = int(input())
x = list(map(int, input().split()))
x.sort()
left = search_left(x, b + 1)
right = search_right(x, c)
print(num_notes(x, left, right))


import sys

def main():
	(a, b, c) = map(int, sys.stdin.readline().split())
	n = int(sys.stdin.readline())
	note = map(int, sys.stdin.readline().split())
	count = 0
	for e in note:
		if e > b and e < c:
			count += 1
	print(count)
main()


def solve(a, b, c, n, x):
	return sum((1 for i in x if b < i < c))

def main():
	(a, b, c) = list(map(int, input().split()))
	n = int(input())
	x = list(map(int, input().split()))
	print(solve(a, b, c, n, x))
main()


(n, m, k) = map(int, input().split())
a = int(input())
l = list(map(int, input().split()))
ans = 0
for i in l:
	if i > m and i < k:
		ans += 1
print(ans)


def solution(l1, v2, l3):
	oleg = l1[0]
	l1.remove(oleg)
	security1 = min(l1)
	security2 = max(l1)
	ans = 0
	if oleg < security1:
		l3 = [x for x in l3 if x < security1]
		return len(l3)
	elif oleg > security1 and oleg < security2:
		l3 = [x for x in l3 if x > security1 and x < security2]
		return len(l3)
	else:
		l3 = [x for x in l3 if x > security2]
		return len(l3)

def answer():
	l1 = [int(x) for x in input().split()]
	v2 = int(input())
	l3 = [int(x) for x in input().split()]
	print(solution(l1, v2, l3))
answer()


X = list(map(int, input().split()))
input()
BankNote = list(map(int, input().split()))
Counter = 0
for i in BankNote:
	if i > X[1] and i < X[2]:
		Counter += 1
print(Counter)


I = lambda : int(input())
IL = lambda : list(map(int, input().split()))
(a, b, c) = IL()
n = I()
X = IL()
print(len([1 for x in X if b < x < c]))


def get_notes(positions, pos1, pos2):
	count = 0
	for position in positions:
		if position > pos1 and position < pos2:
			count += 1
	return count
(pos1, pos2, pos3) = map(int, input().split())
ammount = map(int, input().split())
positions = list(map(int, input().split()))
result = get_notes(positions, pos2, pos3)
print(result)


(a, b, e) = map(int, input().split())
c = int(input())
d = list(map(int, input().split()))
g = 0
for i in d:
	if b < i < e:
		g += 1
print(g)


(a, b, c) = map(int, input().split())
_ = input()
bn = list(map(int, input().split()))
bn = [item for item in bn if item < c and item > b]
print(len(bn))


(a, b, c) = map(int, input().split())
n = int(input())
x = list(map(int, input().split()))
dic = {}
for i in range(1, n + 1):
	xi = x[i - 1]
	if xi in dic:
		dic[xi].append(i)
	else:
		dic[xi] = [i]
ans = 0
for (k, v) in dic.items():
	if b < k < c:
		ans += len(v)
print(ans)


(a, b, c) = [int(x) for x in input().split()]
N = int(input())
m = [int(x) for x in input().split()]
count = 0
for i in range(N):
	if m[i] > b and m[i] < c:
		count += 1
print(count)


(a, b, c) = map(int, input().split())
n = int(input())
x = sorted(list(map(int, input().split())))
ans = 0
for s in x:
	if b < s and s < c:
		ans += 1
print(ans)


(c, g1, g2) = map(int, input().strip().split())
notes = int(input())
arr = list(map(int, input().split()))
z = 0
for i in arr:
	if i > g1 and i < g2:
		z = z + 1
print(z)


(a, b, c) = (int(x) for x in input().split())
n = int(input())
bills = [int(x) for x in input().split()]
ans = 0
for bill in bills:
	if b < bill < c:
		ans += 1
print(ans)


(w, x, y) = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
b = [i for i in a if i > x and i < y]
print(len(b))


import sys
import math
import bisect
import itertools

def main():
	(a, b, c) = map(int, input().split())
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	ans = 0
	if c - b >= 2:
		l = b + 1
		r = c - 1
		first = bisect.bisect_left(A, l)
		last = bisect.bisect_right(A, r)
		ans = last - first
	print(ans)
main()


(a, b, c) = map(int, input().split())
s = 0
input()
for i in map(int, input().split()):
	if i > b and i < c:
		s += 1
print(s)


import sys
line = sys.stdin.readline().split()
a = int(line[0])
b = int(line[1])
c = int(line[2])
n = sys.stdin.readline().split()[0]
notes = sys.stdin.readline().split()
notes = list(map(int, notes))
total = 0
for note in notes:
	if note > b and note < c:
		total += 1
print(total)


(m, x, y) = map(int, input().split())
n = int(input())
l = list(map(int, input().split()))
c = 0
for i in range(n):
	if l[i] > x and l[i] < y:
		c += 1
print(c)


def ograblenie(b, c, lst):
	oleg = 0
	for elem in lst:
		if b < elem < c:
			oleg += 1
	return oleg
(A, B, C) = [int(i) for i in input().split()]
n = int(input())
x = [int(j) for j in input().split()]
print(ograblenie(B, C, x))


(a, b, c) = map(int, input().split())
n = int(input())
d = list(map(int, input().split()))
w = 0
for i in d:
	if i in range(b + 1, c):
		w += 1
print(w)


(a, b, c) = map(int, input().split())
n = int(input())
v = [int(x) for x in input().split()]
count = 0
for i in range(len(v)):
	if v[i] > b and v[i] < c:
		count += 1
print(count)


(n, b, c) = map(int, input().split())
v = 0
f = int(input())
a = map(int, input().split())
a = list(a)
for i in range(f):
	if n > b and n < c:
		if a[i] < c and a[i] > b:
			v += 1
	elif n < b:
		if a[i] < b:
			v += 1
	elif n > c:
		if a[i] > c:
			v += 1
print(v)


import sys

def solve():
	(a, b, c) = map(int, input().split())
	n = int(input())
	x = [int(i) for i in input().split()]
	ans = sum((b < xi < c for xi in x))
	print(ans)
solve()


(o, l, r) = map(int, input().split())
n = int(input())
a = map(int, input().split())
ans = 0
for x in a:
	if x > l and x < r:
		ans += 1
print(ans)


f = list(map(int, input().split()))
(n, c) = (int(input()), 0)
bn = list(map(int, input().split()))
for i in bn:
	if i in range(f[1] + 1, f[2]):
		c = c + 1
print(c)


(a, b, c) = map(int, input().split())
n = int(input())
l = list(map(int, input().split()))
print(sum([1 for i in range(n) if l[i] in range(b + 1, c)]))


l = list(map(int, input().rstrip().split()))
n = int(input())
l1 = list(map(int, input().rstrip().split()))
c = 0
for i in l1:
	if i > l[1] and i < l[2]:
		c += 1
print(c)


(x, y, z) = list(map(int, input().split()))
(t, n) = (int(input()), 0)
p = list(map(int, input().split()))
for i in p:
	if y < i and i < z:
		n += 1
print(n)


(a, b, c) = map(int, input().split())
num = int(input())
arr = list(map(int, input().split()))
ct = 0
for n in arr:
	if b < n < c:
		ct += 1
print(ct)


import math
import re
(a, b, c) = map(int, input().split())
n = int(input())
x = list(map(int, input().split()))
res = 0
for el in x:
	if b < el < c:
		res += 1
print(res)


(a, b, c) = tuple(map(int, input().strip().split()))
_ = input()
notes = list(map(int, input().strip().split()))
cnt = 0
for note in notes:
	if note > b and note < c:
		cnt += 1
print(cnt)


(n, m, k) = map(int, input().split())
z = int(input())
l = [int(i) for i in input().split()]
p = 0
for i in l:
	if m < i < k:
		p += 1
print(p)


first_line = list(map(int, input().split()))
(oleg, l_officer, r_officer) = first_line
n = int(input())
safes = list(map(int, input().split()))
counter = 0
for safe in safes:
	if safe > l_officer and safe < r_officer:
		counter += 1
print(counter)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	(a, b, c) = LI()
	n = I()
	ans = 0
	l = LI()
	for x in l:
		if b < x < c:
			ans += 1
	return ans
print(main())


(a, b, c) = list(map(int, input().split()))
n = int(input())
x = list(map(int, input().split()))
print(sum((b < v < c for v in x)))


(a, b, c) = [int(i) for i in input().split()]
n = int(input())
xs = [int(i) for i in input().split()]
amount = 0
for i in xs:
	if i > b and i < c:
		amount += 1
print(amount)


(a, b, c) = map(int, input().split())
n = int(input())
arr = [int(i) for i in input().split()]
ans = 0
leng = len(arr)
for i in range(leng):
	if arr[i] > b and arr[i] < c:
		ans += 1
print(ans)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
(a, b, c) = get_int_list()
n = get_int()
lst = get_int_list()
count = 0
for i in lst:
	if b < i and i < c:
		count += 1
print(count)


(a, b, c) = map(int, input().split())
q = int(input())
l = list(map(int, input().split()))
s = 0
for i in range(q):
	if l[i] > b and l[i] < c:
		s += 1
print(s)


def oleg_grabit(lst, b, c):
	result = 0
	for elem in lst:
		if b < elem < c:
			result += 1
	return result
(A, B, C) = [int(i) for i in input().split()]
n = int(input())
z = [int(j) for j in input().split()]
print(oleg_grabit(z, B, C))


alph = 'abcdefghijklmnopqrstuvwxyz'
(a, b, c) = map(int, input().split())
n = int(input())
x = list(map(int, input().split()))
E = 0
for i in range(n):
	if x[i] > b and x[i] < c:
		E += 1
print(E)


(n, m, t) = map(int, input().split())
s = int(input())
l = list(map(int, input().split()))
h = 0
for i in range(len(l)):
	if l[i] > m and l[i] < t:
		h += 1
print(h)


(n, m, k) = map(int, input().split())
n = int(input())
price = sorted(list(map(int, input().split())))
x = -1
y = -1
for i in range(n):
	if price[i] > m:
		x = i
		break
price.reverse()
for i in range(n):
	if price[i] < k:
		y = n - i
		break
if x == -1 or y == -1:
	print(0)
else:
	print(y - x)


(a, b, c) = [int(x) for x in input().split()]
d = 0
n = input()
aa = [int(x) for x in input().split()]
ans = sum([1 for x in aa if b < x < c])
print(ans)


(_, b, c) = map(int, input().split())
(_, s) = (input(), 0)
for i in map(int, input().split()):
	s += i in range(b + 1, c)
print(s)


(a, b, c) = list(map(int, input().strip().split()))
n = int(input())
l = list(map(int, input().strip().split()))
t = 0
if a <= b:
	for i in l:
		if i < b:
			t += 1
	print(t)
elif a > b and c >= a:
	for i in l:
		if i > b and i < c:
			t += 1
	print(t)
else:
	for i in l:
		if i > c:
			t += 1
	print(t)


class CodeforcesTask794ASolution:

	def __init__(self):
		self.result = ''
		self.a_b_c = []
		self.n = 0
		self.banknotes = []

	def read_input(self):
		self.a_b_c = [int(x) for x in input().split(' ')]
		self.n = int(input())
		self.banknotes = [int(x) for x in input().split(' ')]

	def process_task(self):
		notes = 0
		for note in self.banknotes:
			if self.a_b_c[1] < note < self.a_b_c[2]:
				notes += 1
		self.result = str(notes)

	def get_result(self):
		return self.result
Solution = CodeforcesTask794ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


(cur, att_first, att_second) = map(int, input().split())
input()
l = list(map(int, input().split()))
moneys = 0
for x in l:
	if att_first < x < att_second:
		moneys += 1
print(moneys)


(oleg, police_1, police_2) = map(int, input().split())
number_of_notes = int(input())
list = [int(x) for x in input().split()]
bank_notes = 0
if police_1 < oleg and oleg < police_2:
	for num in list:
		if police_1 < num < police_2:
			bank_notes += 1
	print(bank_notes)
else:
	print(bank_notes)


(a, b, c) = map(int, input().split())
d = int(input())
l = list(map(int, input().split()))
i = 0
e = 0
while i < d:
	if l[i] > b and l[i] < c:
		e += 1
	i += 1
print(e)


def main():
	[oleg, guard_left, guard_right] = [int(_) for _ in input().split()]
	input()
	notes = [int(_) for _ in input().split()]
	result = sum((guard_left < safe < guard_right for safe in notes))
	print(result)
main()


s = input()
s = s.split()
a = int(s[0])
b = int(s[1])
c = int(s[2])
n = int(input())
s = input()
s = s.split()
count = 0
for i in range(n):
	if int(s[i]) > b and int(s[i]) < c:
		count += 1
print(count)


(oleg, seq1, seq2) = map(int, input().split())
lenofqup = int(input())
qup = map(int, input().split())
s = 0
if seq1 < oleg < seq2:
	for i in qup:
		if seq1 < i < seq2:
			s += 1
elif oleg < seq1:
	for i in qup:
		if i < seq1:
			s += 1
elif seq2 < oleg:
	for i in qup:
		if seq2 < i:
			s += 1
print(s)


(a, b, c) = [int(p) for p in input().split()]
_ = input()
arr = [int(p) for p in input().split()]
mp = {}
summ = 0
for (i, num) in enumerate(arr):
	if num not in mp:
		mp[num] = 0
	mp[num] += 1
	if num > b and num < c:
		summ += 1
print(summ)


t = list(map(int, input().split()))
a = t[0]
b = t[1]
c = t[2]
num = int(input())
safes = {}
t = list(map(int, input().split()))
res = 0
for i in range(num):
	if b < t[i] < c:
		res += 1
print(res)


(a, b, c) = list(map(int, input().split()))
n = int(input())
cnt = 0
for ch in input().split():
	sl = int(ch)
	if sl > b and sl < c:
		cnt += 1
print(cnt)


(a, b, c) = [int(i) for i in input().split()]
n = int(input())
x = [int(i) for i in input().split()]
t = 0
for i in range(n):
	if b == c:
		if a < b:
			if x[i] < b:
				t += 1
		elif a > b:
			if x[i] > b:
				t += 1
	elif x[i] > b and x[i] < c:
		t += 1
print(t)


(a, b, c) = map(int, input().split())
n = int(input())
l = list(map(int, input().split()))
d = 0
for i in range(len(l)):
	if l[i] > b and l[i] < c:
		d += 1
print(d)


import sys
import os
(a, b, c) = map(int, input().split())
n = int(input())
X = list(map(int, input().split()))
ans = 0
for x in X:
	if b < x < c:
		ans += 1
print(ans)


(x, y, z) = map(int, input().split())
n = int(input())
count = 0
list = [int(i) for i in input().split()]
for i in range(len(list)):
	if y < list[i] and list[i] < z:
		count += 1
print(count)


(ol, g1, g2) = input().split()
ol = int(ol)
g1 = int(g1)
g2 = int(g2)
num = int(input())
all_safes = [int(i) for i in input().split()]
count = 0
for i in all_safes:
	if i > g1 and i < g2:
		count += 1
print(count)


(a, b, c) = [int(x) for x in input().split()]
n = int(input())
banknotes = [int(x) for x in input().split()]
res = 0
for note in banknotes:
	if note > b and note < c:
		res += 1
print(res)


(a, b, c) = map(int, input().split())
n = int(input())
mass = list(map(int, input().split()))
mon = 0
for i in range(len(mass)):
	if b < mass[i] < c:
		mon += 1
print(mon)