There are n kangaroos with pockets. Each kangaroo has a size (integer number). A kangaroo can go into another kangaroo's pocket if and only if the size of kangaroo who hold the kangaroo is at least twice as large as the size of kangaroo who is held.

Each kangaroo can hold at most one kangaroo, and the kangaroo who is held by another kangaroo cannot hold any kangaroos.

The kangaroo who is held by another kangaroo cannot be visible from outside. Please, find a plan of holding kangaroos with the minimal number of kangaroos who is visible.


-----Input-----

The first line contains a single integer — n (1 ≤ n ≤ 5·10^5). Each of the next n lines contains an integer s_{i} — the size of the i-th kangaroo (1 ≤ s_{i} ≤ 10^5).


-----Output-----

Output a single integer — the optimal number of visible kangaroos.


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

Output
5

Input
8
9
1
6
2
6
5
8
3

Output
5

Difficulty: MEDIUM_HARD
Tags: Sorting

Amortized analysis

Greedy algorithms
Skill types: Sorting

Amortized analysis

Greedy algorithms

Starter code:

Solutions:
import bisect
from itertools import accumulate, count
import os
import sys
import math
from decimal import *
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def SieveOfEratosthenes(n):
	prime = []
	primes = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if primes[p] == True:
			for i in range(p * p, n + 1, p):
				primes[i] = False
		p += 1
	for i in range(2, len(primes)):
		if primes[i] == True:
			prime.append(i)
	return prime

def primefactors(n):
	fac = []
	while n % 2 == 0:
		fac.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 2):
		while n % i == 0:
			fac.append(i)
			n = n // i
	if n > 1:
		fac.append(n)
	return fac

def factors(n):
	fac = set()
	fac.add(1)
	fac.add(n)
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			fac.add(i)
			fac.add(n // i)
	return list(fac)

def NcR(n, r):
	p = 1
	k = 1
	if n - r < r:
		r = n - r
	if r != 0:
		while r:
			p *= n
			k *= r
			m = math.gcd(p, k)
			p //= m
			k //= m
			n -= 1
			r -= 1
	else:
		p = 1
	return p

def Log2(x):
	if x == 0:
		return False
	return math.log10(x) / math.log10(2)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))
n = int(input())
a = []
for i in range(n):
	p = int(input())
	a.append(p)
a.sort()
ans = 0
r = n - 1
for i in range(n // 2 - 1, -1, -1):
	if a[i] * 2 <= a[r]:
		r -= 1
		ans += 1
print(n - ans)


from sys import stdin
input = stdin.readline
n = int(input())
l = []
for _ in range(n):
	l.append(int(input()))
l.sort()
m = (n + 1) // 2
m = n - m
(i, j) = (0, m)
while i < m and j < n:
	if l[j] >= 2 * l[i]:
		i += 1
	j += 1
print(n - i)


from collections import defaultdict
import sys
sys.setrecursionlimit(10 ** 8)
try:
	FILE_POINTER = open('input.inpt')
	input = FILE_POINTER.readline
except:
	FILE_POINTER = None
	input = sys.stdin.readline
n = int(input())
arr = []
for _ in range(n):
	arr.append(int(input()))
arr.sort(reverse=True)
ans = 0
i = 0
j = n // 2
hs = [1] * n
while j < n:
	while j < n and arr[j] > arr[i] // 2:
		j += 1
	if i < n and j < n:
		hs[i] = hs[j] = 0
		ans += 1
		i += 1
		j += 1
for i in range(n):
	if hs[i]:
		ans += 1
print(ans)
if FILE_POINTER:
	FILE_POINTER.close()


import os
import sys
from io import BytesIO, IOBase
from bisect import bisect_left as bl
from bisect import bisect_right as br

def main():
	n = int(input())
	a = []
	for x in range(n):
		a.append(int(input()))
	a.sort(reverse=True)
	low = 0
	high = n // 2
	cnt = 0
	yoyo = set()
	while low < n and high < n:
		if a[low] >= 2 * a[high] and low not in yoyo:
			yoyo.add(high)
			cnt += 1
			low += 1
			high += 1
		else:
			high += 1
	print(n - cnt)
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')
main()


import bisect
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')
x = int(input())
l = []
for i in range(x):
	y = int(input())
	l.append(y)
l.sort()
n = len(l)
if n % 2 == 0:
	xx = int(n / 2)
	aa = int(n / 2)
	k = 1
	while aa - k >= 0 and l[aa - k] * 2 > l[-1]:
		k += 1
	cc = 0
	i = 1
	j = 1
	while aa - k + 1 - i >= 0:
		if l[aa - k + 1 - i] * 2 <= l[-j]:
			cc += 1
			i += 1
			j += 1
		else:
			i += 1
	print(n - cc)
else:
	xx = int(n // 2)
	aa = int(n // 2)
	k = 1
	while aa - k >= 0 and l[aa - k] * 2 > l[-1]:
		k += 1
	cc = 0
	i = 1
	j = 1
	while aa - k + 1 - i >= 0:
		if l[aa - k + 1 - i] * 2 <= l[-j]:
			cc += 1
			i += 1
			j += 1
		else:
			i += 1
	print(n - cc)


import sys
import math
n = int(input())
k = sorted((int(x) for x in sys.stdin))
p1 = n // 2 - 1
p2 = n - 1
count = 0
while p2 > n // 2 - 1 and p1 >= 0:
	if k[p1] * 2 <= k[p2]:
		p2 -= 1
		count += 1
	p1 -= 1
print(n - count)


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 prime_factors(x):
	s = set()
	n = x
	i = 2
	while i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			s.add(i)
		i += 1
	if n > 1:
		s.add(n)
	return s
from collections import Counter
import heapq
from collections import Counter
from bisect import bisect_right
import heapq
n = int(input())
import bisect

def can(x):
	a = arr[:x]
	cnt = 0
	for i in range(x - 1, -1, -1):
		var = n - bisect.bisect_left(arr, 2 * a[i])
		var -= cnt
		if var >= 1:
			pass
		else:
			return False
		cnt += 1
	return True
arr = []
for i in range(n):
	m = int(input())
	arr.append(m)
arr.sort()
l = 0
r = n // 2
ans = -1
while l <= r:
	mid = (l + r) // 2
	if can(mid):
		ans = mid
		l = mid + 1
	else:
		r = mid - 1
print(n - ans)


from sys import stdin, stdout
import math
n = int(input())
a = sorted(list((int(stdin.readline()) for i in range(n))))
mid = math.floor((n - 1) / 2)
c = 0
i = n - 1
x = mid
k = n
while x >= 0:
	if 2 * a[x] <= a[i]:
		k -= 1
		i -= 1
	x -= 1
k = max(math.ceil(n / 2), k)
stdout.write(str(k))


import sys
input = sys.stdin.buffer.readline

def solution():
	n = int(input())
	l = []
	for i in range(n):
		x = int(input())
		l.append(x)
	l.sort()
	i = 0
	j = n // 2
	ans = n
	for i in range(n // 2):
		while j < n:
			if 2 * l[i] <= l[j]:
				ans -= 1
				j += 1
				break
			else:
				j += 1
	print(ans)
solution()


input = __import__('sys').stdin.readline
n = int(input())
lis = []
for i in range(n):
	lis.append(int(input()))
lis.sort()
i = n // 2 - 1
j = n - 1
ans = n
while i >= 0 and j > 0:
	if lis[i] * 2 <= lis[j]:
		ans -= 1
		i -= 1
		j -= 1
	else:
		i -= 1
print(ans)


n = int(input())
ls = sorted([int(input()) for _ in range(n)])
cnt = 0
mid = n // 2 - 1
right = n - 1
while mid >= 0 and right > mid:
	if ls[mid] * 2 <= ls[right]:
		cnt += 1
		right -= 1
	mid -= 1
print(n - cnt)


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
n = int(input())
s = []
for _ in range(n):
	size = int(input())
	s.append(size)
s.sort()
mid = n // 2 - 1
l = 0
r = n - 1
while mid >= 0:
	if s[mid] * 2 <= s[r]:
		r -= 1
		l += 1
	mid -= 1
print(n - l)


import sys
n = int(input())
ls = []
for _ in range(n):
	s = sys.stdin.readline()
	ls.append(int(s))
ls.sort()
cnt = 0
mid = n // 2 - 1
right = n - 1
mated = 0
for _ in range(n // 2):
	if ls[right] >= 2 * ls[mid] and mid >= 0:
		cnt += 1
		mid -= 1
		right -= 1
		mated += 2
	else:
		mid -= 1
print(cnt + n - mated)


import sys
input = sys.stdin.readline
a = int(input())
z = []
for i in range(a):
	r = int(input())
	z.append(r)
z.sort()
l = 0
r = a // 2
count = 0
while l < a // 2 and r < len(z):
	if z[l] * 2 <= z[r]:
		count += 1
		r += 1
		l += 1
	else:
		r += 1
print(len(z) - count)


import sys

def sol(a, n):
	a.sort()
	i = 0
	j = n // 2
	ans = n
	while i < n // 2 and j < n:
		if 2 * a[i] <= a[j]:
			ans -= 1
			i += 1
			j += 1
		else:
			j += 1
	return ans
n = int(input())
a = [int(i) for i in sys.stdin]
print(sol(a, n))


def main():
	from sys import stdin
	n = int(input())
	l = sorted(map(int, stdin.read().splitlines()), reverse=True)
	ita = iter(enumerate(l))
	(i, a) = next(ita)
	for b in l[(n + 1) // 2:]:
		if a >= b * 2:
			(i, a) = next(ita)
	print(n - i)
main()


n = int(input())
w = []
for _ in range(n):
	w.append(int(input()))
w.sort()
ans = n
j = n // 2
for i in range(n // 2):
	while j < n:
		if 2 * w[i] <= w[j]:
			ans -= 1
			j += 1
			break
		j += 1
	if j >= n:
		break
print(ans)


n = int(input())
k = sorted([int(input()) for _ in range(n)])
j = n - 1
count = 0
for i in range(n // 2 - 1, -1, -1):
	if k[i] * 2 <= k[j]:
		j -= 1
		count += 1
print(n - count)


import sys
import math
n = int(input())
a = sorted((int(x) for x in sys.stdin))
i = n // 2 - 1
j = n - 1
k = 0
while j > n // 2 - 1 and i >= 0:
	b = int(2 * a[i] <= a[j])
	j -= 1 * b
	k += 1 * b
	i -= 1
print(n - k)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def solution():
	n = int(input())
	a = []
	for _ in range(n):
		a.append(int(input()))
	a.sort()
	l = n // 2
	count = 0
	t = n - 1
	for i in range(l - 1, -1, -1):
		if a[i] * 2 <= a[t]:
			count += 1
			t = t - 1
	print(n - count)
solution()


n = int(input())
l = sorted([int(input()) for i in range(n)])
ans = n
j = n - 1
for i in range(n // 2 - 1, -1, -1):
	if l[i] * 2 <= l[j]:
		j -= 1
		ans -= 1
print(ans)


bot = True
import math, sys
n = int(input())
k = n
a = sorted([int(x) for x in sys.stdin.read().strip().split('\n')])
p1 = math.floor((n - 1) / 2)
p2 = n - 1
while p1 >= 0:
	if 2 * a[p1] <= a[p2]:
		k -= 1
		a[p2] = 0
		p2 -= 1
	p1 -= 1
k = max(math.ceil(n / 2), k)
sys.stdout.write(str(k))


def kangaroo(n, array):
	from math import ceil
	first = array[0:int(ceil(n / 2))]
	second_half = array[int(ceil(n / 2)):]
	count = 0
	i = 0
	j = 0
	for step in range(len(second_half)):
		if second_half[i] >= 2 * first[j]:
			count += 1
			i += 1
			j += 1
		else:
			i += 1
			count += 1
	print(len(first) - j + count)

def main():
	array = []
	n = int(input())
	for i in range(n):
		array.append(input())
	array = sorted(tuple(map(int, array)))
	kangaroo(n, array)
main()


from math import floor
from sys import stdin
n = int(input())
sizes = sorted([int(x) for x in stdin.read().strip().split('\n')])
middle = floor(n / 2)
leftie = middle - 1
rightie = n - 1

def get_size(index):
	return sizes[index]
while leftie >= 0:
	if get_size(leftie) * 2 <= get_size(rightie):
		n -= 1
		rightie -= 1
	leftie -= 1
print(n)


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import *
getcontext().prec = 25
MOD = pow(10, 9) + 7
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')
n = int(input())
l = [int(input()) for i in range(n)]
l.sort()
a = l[-1] // 2
x = n // 2 + n % 2
i = 0
c = 0
while l[i] <= a and x < n:
	if l[i] <= l[x] // 2:
		c += 1
		i += 1
		x += 1
	else:
		x += 1
print(n - c)


import sys
from math import sqrt
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = int(input())
size = []
for i in range(n):
	size.append(int(input()))
if len(size) == 1:
	print('1')
else:
	size = sorted(size)
	left = 0
	leftCur = 0
	right = int(n / 2)
	rightCur = right
	res = 0
	while leftCur < right and rightCur < n:
		leftVal = size[leftCur]
		rightVal = size[rightCur]
		if leftVal * 2 <= rightVal:
			res += 1
			leftCur += 1
			rightCur += 1
		else:
			rightCur += 1
	print(n - res)


import sys
n = int(sys.stdin.readline().lstrip().rstrip())
arr = []
for i in range(n):
	arr.append(int(sys.stdin.readline().lstrip().rstrip()))
arr.sort()
ans = 0
(a, b) = (0, n // 2)
while a < n // 2 and b < n:
	if arr[a] * 2 <= arr[b]:
		ans += 1
		a += 1
		b += 1
	else:
		b += 1
sys.stdout.write(str(n - ans) + '\n')


import sys
input = sys.stdin.readline
a = int(input())
ans = []
for i in range(a):
	s = int(input())
	ans.append(s)
ans.sort()
g1 = []
g2 = []
from heapq import *
for i in range(len(ans) // 2):
	g1.append(ans[i])
for i in range(len(ans) // 2, len(ans)):
	heappush(g2, ans[i])
pairs = 0
for i in range(len(g1)):
	while len(g2) and g2[0] < g1[i] * 2:
		heappop(g2)
	if len(g2) == 0:
		break
	pairs += 1
	heappop(g2)
print(len(ans) - pairs)


from sys import stdin, stdout
a = []
n = int(stdin.readline())
for _ in range(n):
	a.append(int(stdin.readline()))
a.sort()
j = n // 2
ans = n
for i in range(n // 2):
	while j < n:
		if a[i] * 2 <= a[j]:
			ans -= 1
			j += 1
			break
		else:
			j += 1
		if j == n:
			break
	if j == n:
		break
stdout.write(str(ans) + '\n')


n = int(input())
arr = sorted([int(input()) for _ in range(n)])
l = n // 2 - 1
r = n - 1
res = 0
while l >= 0 and r > n // 2 - 1:
	if arr[l] * 2 <= arr[r]:
		res += 1
		r -= 1
	l -= 1
print(n - res)


import sys
import math
n = int(input())
a = sorted(list((int(sys.stdin.readline()) for i in range(n))))
i = n // 2 - 1
j = n - 1
k = 0
while j > n // 2 - 1 and i >= 0:
	if 2 * a[i] <= a[j]:
		j -= 1
		k += 1
	i -= 1
print(n - k)


import sys
import io, os
import math
gcd = math.gcd
ceil = math.ceil
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
list = []
n = int(input())
for i in range(n):
	list.append(int(input()))
list.sort()
s = n
l = 1
r = s
if list[0] == list[-1]:
	print(s)
	sys.exit()

def condition(x):
	if 2 * x < s:
		return False
	rem = s - x
	for i in range(rem - 1, -1, -1):
		if 2 * list[i] <= list[x + i]:
			continue
		else:
			return False
	return True
while r - l > 1:
	mid = (l + r) // 2
	if condition(mid):
		r = mid
	else:
		l = mid
print(r)


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd, log
from collections import deque
from bisect import bisect_left, bisect_right
n = int(input())
l = []
for i in range(n):
	a = int(input())
	l.append(a)
l.sort()
j = n - 1
count = 0
i = n // 2 - 1
while i >= 0:
	if 2 * l[i] <= l[j]:
		count += 1
		j -= 1
	i -= 1
print(n - count)


import sys
from collections import deque
input = sys.stdin.readline

def print(x, end='\n'):
	sys.stdout.write(str(x) + end)

def binary(x, arr, l, r):
	while l <= r:
		mid = (l + r) // 2
		if arr[mid] < 2 * x:
			l = mid + 1
		elif mid > l and arr[mid] >= 2 * x and (arr[mid - 1] >= 2 * x):
			r = mid - 1
		elif mid > l and arr[mid] >= 2 * x and (arr[mid - 1] < 2 * x):
			return mid
		elif mid == l and arr[mid] >= 2 * x:
			return mid
	return -1

def main():
	N = int(input())
	arr = [0] * N
	for i in range(N):
		arr[i] = int(input())
	if N == 1:
		print(1)
	else:
		arr.sort()
		visible = 0
		Bool = False
		l = N // 2
		r = N - 1
		for x in range(N // 2):
			boo = binary(arr[x], arr, l, r)
			if boo == -1:
				Bool = True
				visible += N // 2 - x
				visible += r - l + 1
				break
			else:
				visible += 1
				visible += boo - l
				l = boo + 1
		if not Bool:
			visible += r - l + 1
		print(visible)
	pass
main()


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')
n = int(input())
arr = [0] * n
for i in range(n):
	arr[i] = int(input())
arr.sort()
small = 0
big = n // 2
hidden = 0
while small < n // 2 and big < n:
	if arr[big] >= arr[small] * 2:
		small += 1
		big += 1
		hidden += 1
	else:
		big += 1
print(n - hidden)


from math import *
from collections import *
from random import *
from decimal import Decimal
from bisect import *
import sys
input = sys.stdin.readline

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

def ma():
	return map(int, input().split())

def inp():
	return int(input())

def fk(a, s, k):
	b = []
	for i in range(len(a)):
		b.append(a[i] + (i + 1) * k)
	b.sort()
	return sum(b[:k])
n = inp()
r = []
for i in range(n):
	x = inp()
	r.append(x)
r.sort()
co = 0
po = 0
po1 = 0
for i in range(n // 2):
	if po1 + n // 2 == n:
		break
	if r[po] * 2 <= r[n // 2 + po1]:
		co += 1
		po1 += 1
		po += 1
		continue
	else:
		po1 += 1
print(n - 2 * co + co)


from sys import stdin

def run(n, s):
	m = 0
	small = n // 2
	for big in range(n - 1, (n + 1) // 2 - 1, -1):
		while small >= 0 and s[small] > s[big] / 2:
			small -= 1
		if small == -1:
			break
		small -= 1
		m += 1
	print(n - m)
n = int(input())
s = sorted([int(x) for x in stdin.read().strip().split('\n')])
run(n, s)


import sys
import math
n = int(input())
k = [int(x) for x in sys.stdin]
size = 5 * 10 ** 5 + 4
r = [0] * size
c = [0] * size
for i in k:
	r[i // 2] += 1
	c[i] += 1
t = b = 0
result = n
for i in range(size - 1, -1, -1):
	r[i] += t
	t = r[i]
	if c[i] > 0:
		result -= min(c[i], r[i] - b)
		b += min(c[i], r[i] - b)
	if result <= (n + 1) // 2:
		break
print(max(result, (n + 1) // 2))


import sys
n = int(input())
arr = sorted([int(i) for i in sys.stdin])
l = n // 2 - 1
r = n - 1
res = 0
while l >= 0 and r > n // 2 - 1:
	if arr[l] * 2 <= arr[r]:
		res += 1
		r -= 1
	l -= 1
print(n - res)


from math import ceil

def solve(kangaroos):
	kangaroos.sort(reverse=True)
	middle = ceil(len(kangaroos) / 2) - 1
	i = 0
	j = middle + 1
	result = len(kangaroos)
	while i <= middle:
		while j < len(kangaroos) and kangaroos[j] * 2 > kangaroos[i]:
			j += 1
		if j == len(kangaroos):
			break
		result -= 1
		i += 1
		j += 1
	return result
n = int(input())
kangaroos = [int(input()) for x in range(n)]
print(solve(kangaroos))


import sys
from math import gcd, sqrt, ceil, log2
from collections import defaultdict, Counter, deque
from bisect import bisect_left, bisect_right
import math
sys.setrecursionlimit(2 * 10 ** 5 + 10)
import heapq
from itertools import permutations
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 get_sum(bit, i):
	s = 0
	i += 1
	while i > 0:
		s += bit[i]
		i -= i & -i
	return s

def update(bit, n, i, v):
	i += 1
	while i <= n:
		bit[i] += v
		i += i & -i

def modInverse(b, m):
	g = math.gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def primeFactors(n):
	sa = set()
	sa.add(n)
	while n % 2 == 0:
		sa.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			sa.add(i)
			n = n // i
	return sa

def seive(n):
	pri = [True] * (n + 1)
	p = 2
	while p * p <= n:
		if pri[p] == True:
			for i in range(p * p, n + 1, p):
				pri[i] = False
		p += 1
	return pri

def check_prim(n):
	if n < 0:
		return False
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def getZarr(string, z):
	n = len(string)
	(l, r, k) = (0, 0, 0)
	for i in range(1, n):
		if i > r:
			(l, r) = (i, i)
			while r < n and string[r - l] == string[r]:
				r += 1
			z[i] = r - l
			r -= 1
		else:
			k = i - l
			if z[k] < r - i + 1:
				z[i] = z[k]
			else:
				l = i
				while r < n and string[r - l] == string[r]:
					r += 1
				z[i] = r - l
				r -= 1

def search(text, pattern):
	concat = pattern + '$' + text
	l = len(concat)
	z = [0] * l
	getZarr(concat, z)
	ha = []
	for i in range(l):
		if z[i] == len(pattern):
			ha.append(i - len(pattern) - 1)
	return ha

def mergeIntervals(arr):
	arr.sort(key=lambda x: x[0])
	m = []
	s = -10000
	max = -100000
	for i in range(len(arr)):
		a = arr[i]
		if a[0] > max:
			if i != 0:
				m.append([s, max])
			max = a[1]
			s = a[0]
		elif a[1] >= max:
			max = a[1]
	if max != -100000 and [s, max] not in m:
		m.append([s, max])
	return m

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def sol(n):
	seti = set()
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			seti.add(n // i)
			seti.add(i)
	return seti

def lcm(a, b):
	return a * b // gcd(a, b)
n = int(input())
la = []
for i in range(n):
	la.append(int(input()))
la.sort()
mid = n // 2 - 1
r = n - 1
s = 0
while mid >= 0:
	if 2 * la[mid] <= la[r]:
		r -= 1
		s += 1
	mid -= 1
print(n - s)


import sys
lines = sys.stdin.readlines()
n = int(lines[0])
size = []
for l in lines[1:]:
	size.append(int(l))
size.sort()
pt = n // 2
ans = n
for i in range(n // 2):
	while True:
		if size[i] * 2 <= size[pt]:
			ans -= 1
			pt += 1
			break
		else:
			pt += 1
		if pt == n:
			break
	if pt == n:
		break
print(ans)


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
n = iinput()
a = []
for _ in range(n):
	a.append(iinput())
a.sort(reverse=True)
i = 0
j = n // 2
ans = n
vis = [0 for _ in range(n)]
while i < n and j < n:
	if a[i] >= 2 * a[j] and vis[i] == 0 and (vis[j] == 0):
		ans -= 1
		vis[j] = 1
		i += 1
		j += 1
		continue
	if vis[i] == 1:
		i += 1
	else:
		j += 1
print(ans)


import sys
n = int(input())
a = sorted(list((int(x) for x in sys.stdin)))
(i, j, k) = (n // 2 - 1, n - 1, 0)
while j > n // 2 - 1 and i >= 0:
	if 2 * a[i] <= a[j]:
		j -= 1
		k += 1
	i -= 1
print(n - k)


n = int(input())
l = sorted([int(input()) for i in range(n)])
t = n - 1
cnt = 0
for i in range(n // 2 - 1, -1, -1):
	if l[i] * 2 <= l[t]:
		cnt = cnt + 1
		t = t - 1
print(cnt + (n - 2 * cnt))


import sys
n = int(input())
sis = sorted([int(i) for i in sys.stdin])
lowest = sis[0]
current = sis[0]
li = 0
c = n
for x in range(int(n / 2), n):
	if sis[x] >= sis[li] * 2:
		li = li + 1
		c = c - 1
if c < n / 2:
	print(int(n / 2) + int(n % 2))
else:
	print(c)


from sys import stdin, stdout
n = int(input())
kang = [int(x) for x in stdin.read().split()]
kang.sort()
sol = n
p = n // 2
for i in range(n // 2):
	while True:
		if 2 * kang[i] <= kang[p]:
			sol -= 1
			p += 1
			break
		else:
			p += 1
		if p == n:
			break
	if p == n:
		break
stdout.write(str(sol))


l = []
n = int(input())
for i in range(n):
	l.append(int(input()))
l = sorted(l)
ans = n
c = n // 2
for j in range(n // 2):
	while True:
		if 2 * l[j] <= l[c]:
			ans -= 1
			c += 1
			break
		else:
			c += 1
		if c == n:
			break
	if c == n:
		break
print(ans)


import sys
input = sys.stdin.readline
n = int(input())
l = []
for _ in range(n):
	x = int(input())
	l.append(x)
cnt = 0
l.sort()
i = 0
j = n // 2
while i < n // 2 and j < n:
	if l[i] * 2 <= l[j]:
		cnt = cnt + 1
		j = j + 1
		i = i + 1
	else:
		j = j + 1
print(cnt + (n - cnt * 2))


from sys import stdin
n = int(stdin.readline())
l = [int(line) for line in stdin.readlines()]
l.sort(reverse=True)
ptr = n // 2
ans = n
for i in range(n // 2):
	while ptr < n and l[ptr] * 2 > l[i]:
		ptr += 1
	if ptr < n and l[ptr] * 2 <= l[i]:
		ans -= 1
	ptr += 1
print(ans)


n = int(input())
arr = sorted([int(input()) for _ in range(n)])
r = n - 1
count = 0
for t in range(n // 2 - 1, -1, -1):
	if arr[t] * 2 <= arr[r]:
		r -= 1
		count += 1
print(n - count)


import sys
n = int(input())
a = list(sorted([int(next(sys.stdin)) for _ in range(n)]))
(i, j) = (0, n // 2)
cnt = 0
while j < n:
	if a[i] == -1:
		i += 1
		if i == j:
			j += 1
	elif a[i] * 2 <= a[j]:
		cnt += 1
		a[j] = -1
		i += 1
	j += 1
print(n - cnt)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		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 = self.os.read(self._fd, max(self.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 = self.os.read(self._fd, max(self.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:
			self.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')
import time
start_time = time.time()
import collections as col
import math, string
from functools import reduce

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	A = []
	used = set()
	carriers = col.defaultdict(int)
	for n in range(N):
		A.append(getInt())
	A.sort()
	i = N - 1
	j = N - 1
	ans = N
	while i > -1:
		j = min(i, j, N // 2 - 1)
		if i in used:
			i -= 1
			continue
		while j > -1 and (A[i] < 2 * A[j] or j in used):
			j -= 1
		if j == -1:
			return ans
		assert j < i
		used.add(j)
		carriers[A[i]] = A[j]
		i -= 1
		ans -= 1
	return ans
print(solve())


from sys import stdin
import collections
import os
import sys
from io import IOBase, BytesIO
from sys import stdin, stdout
from math import sqrt
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange

def main():
	n = int(input())
	nn = n
	arr = []
	while nn:
		nn -= 1
		temp = int(input())
		arr.append(temp)
	arr.sort()
	mid = n // 2 - 1
	b = n - 1
	s = 0
	while mid >= 0:
		if arr[mid] * 2 <= arr[b]:
			b -= 1
			s += 1
		mid -= 1
	print(n - s)
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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))

def input():
	return sys.stdin.readline().rstrip('\r\n')

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'
main()


import math, sys, bisect, heapq, os
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
from functools import lru_cache
pr = lambda x: x

def input():
	return sys.stdin.readline().rstrip('\r\n')
aj = lambda : list(map(int, input().split()))

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])

def solve():
	A = []
	for _ in range(int(input())):
		(n,) = aj()
		A.append(n)
	A.sort(reverse=True)
	n = len(A)
	ptr = n // 2
	ans = n
	for i in range(n // 2):
		while ptr < n and A[ptr] * 2 > A[i]:
			ptr += 1
		if ptr < n and A[ptr] * 2 <= A[i]:
			ans -= 1
		ptr += 1
	print(ans)
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	from aj import *
except:
	pass
solve()


import sys
input = sys.stdin.buffer.readline
n = int(input())
l = []
for i in range(0, n):
	l.append(int(input()))
l.sort()
i = n - 1
ans = n
j = n // 2 - 1
while j >= 0 and i >= n // 2:
	if l[j] * 2 <= l[i]:
		i -= 1
		ans -= 1
	j -= 1
print(ans)


import sys
input = sys.stdin.readline
MOD = 1000000007
MOD2 = 998244353
ii = lambda : int(input().strip('\n'))
si = lambda : input().strip('\n')
dgl = lambda : list(map(int, input().strip('\n')))
f = lambda : map(int, input().strip('\n').split())
il = lambda : list(map(int, input().strip('\n').split()))
ls = lambda : list(input().strip('\n'))
lsi = lambda : [int(i) for i in ls()]
let = 'abcdefghijklmnopqrstuvwxyz'
from bisect import bisect_left
n = ii()
l = [ii() for i in range(n)]
l.sort()
ans = n
(i, j) = (0, n // 2)
while i < n // 2 and j < n:
	while j < n and l[j] < 2 * l[i]:
		j += 1
	if j < n:
		ans -= 1
		j += 1
	i += 1
print(ans)


import math
import sys
input = sys.stdin.readline
n = int(input())
a = [0] * n
for i in range(n):
	a[i] = int(input())
a.sort()
p1 = 0
p2 = n // 2
ans = n
while p1 < n // 2 and p2 < n:
	if a[p2] >= 2 * a[p1]:
		p1 += 1
		p2 += 1
		ans -= 1
	else:
		p2 += 1
print(ans)


import sys
n = int(input())
half = int(n / 2)
arr = sorted(list((int(sys.stdin.readline()) for i in range(n))))
ind = 0
for i in range(half, n):
	if arr[ind] * 2 <= arr[i]:
		n -= 1
		ind += 1
	if ind == half:
		break
print(n)


import math
import sys
n = int(input())
lis = sorted((int(x) for x in sys.stdin))
mid = math.ceil(len(lis) // 2)
candl = lis[0:mid]
candr = lis[mid:]
cur = 0
flag = 0
hide = 0
for i in range(len(candl)):
	while candr[cur] < candl[i] * 2:
		cur += 1
		if cur == len(candr):
			flag = 1
			break
	if flag == 0:
		candr[cur] = -1
		hide += 1
	else:
		break
print(n - hide)


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
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')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 10 ** 9 + 7
EPS = 1e-06

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
a = []
for i in range(n):
	a.append(Int())
a.sort(reverse=True)
b = a[n // 2:]
a = a[0:n // 2]
i = 0
j = 0
ans = n
while i < len(a) and j < len(b):
	key = a[i]
	while j < len(b) and key < 2 * b[j]:
		j += 1
	if j != len(b):
		ans -= 1
	j += 1
	i += 1
print(ans)


from sys import stdin
n = int(input())
half = int(n / 2)
arr = sorted([int(x) for x in stdin.read().strip().split('\n')])
ind = 0
for i in range(half, n):
	if arr[ind] * 2 <= arr[i]:
		n -= 1
		ind += 1
	if ind == half:
		break
print(n)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

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

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout
from heapq import heappush, heappop, heapify, _heapify_max, _heappop_max, nsmallest, nlargest
INF = 999999999999999999999999
alphabets = 'abcdefghijklmnopqrstuvwxyz'

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))

class SegTree:

	def __init__(self, n):
		self.N = 1 << n.bit_length()
		self.tree = [0] * (self.N << 1)

	def update(self, i, j, v):
		i += self.N
		j += self.N
		while i <= j:
			if i % 2 == 1:
				self.tree[i] += v
			if j % 2 == 0:
				self.tree[j] += v
			(i, j) = (i + 1 >> 1, j - 1 >> 1)

	def query(self, i):
		v = 0
		i += self.N
		while i > 0:
			v += self.tree[i]
			i >>= 1
		return v

def SieveOfEratosthenes(limit):
	isPrime = [True] * (limit + 1)
	isPrime[0] = isPrime[1] = False
	primes = []
	for i in range(2, limit + 1):
		if not isPrime[i]:
			continue
		primes += [i]
		for j in range(i * i, limit + 1, i):
			isPrime[j] = False
	return primes

def main():
	mod = 1000000007
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	tc = 1
	for _ in range(tc):
		n = ri()
		a = []
		for i in range(n):
			a.append(ri())
		a = sorted(a)
		l = n // 2 - 1
		r = n - 1
		p = 0
		while l >= 0 and r > n // 2 - 1:
			if 2 * a[l] <= a[r]:
				r -= 1
				p += 1
			l -= 1
		wi(n - p)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


import sys
import itertools
import math
import collections
from collections import Counter
input = sys.stdin.readline

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)
n = ii()
a = []
for _ in range(n):
	a.append(ii())
a.sort(reverse=True)
if n == 1:
	exit(print(1))
b = a[n // 2:]
a = a[:n // 2]
res = len(a)
i = j = 0
while i < len(a) and j < len(b):
	while j < len(b):
		if a[i] >= 2 * b[j]:
			i += 1
			j += 1
			break
		else:
			res += 1
			j += 1
	if i == len(a):
		res += len(b) - j
print(res)


import bisect
import sys
from typing import List
input = sys.stdin.readline

def solve(n: int, a: List[int]) -> int:
	held_count = 0
	a = sorted(a)
	(alpha, beta) = (a[:n // 2], a[n // 2:])
	lo = 0
	for e in alpha:
		i = bisect.bisect_left(beta, e * 2, lo)
		if i < len(beta):
			held_count += 1
			lo = i + 1
	return n - held_count
n = int(input())
a = []
for _ in range(n):
	a.append(int(input()))
r = solve(n, a)
print(r)


import sys, os, io
import math, bisect, operator
(inf, mod) = (float('inf'), 10 ** 9 + 7)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
Neo = lambda : list(map(int, input().split()))
(n,) = Neo()
A = [int(input()) for i in range(n)]
A.sort()
ans = n
j = n - 1
for i in range(n // 2 - 1, -1, -1):
	if A[i] * 2 <= A[j]:
		j -= 1
		ans -= 1
print(ans)


from sys import stdin
input = stdin.readline
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
m = (n + 1) // 2
x = n - m
l = s[:m]
r = s[m:]
cnt = 0
(i, j) = (0, 0)
while i < m and j < x:
	if l[i] * 2 <= r[j]:
		cnt += 1
		i += 1
		j += 1
	else:
		j += 1
print(n - cnt)


n = int(input())
a = []
count1 = 0
count2 = 0
from sys import stdin, stdout
for i in range(n):
	a.append(int(stdin.readline()))
a.sort()
while count2 != n // 2:
	if a[count1] * 2 <= a[count2 + n // 2]:
		count1 += 1
		count2 += 1
	else:
		count2 += 1
stdout.write(str(n - count1))


from time import perf_counter
from sys import stdin

def run(n, s):
	m = 0
	small = n // 2
	for big in range(n - 1, (n + 1) // 2 - 1, -1):
		while small >= 0 and s[small] > s[big] / 2:
			small -= 1
		if small == -1:
			break
		small -= 1
		m += 1
	print(n - m)

def run2(n, s):
	r = n - 1
	l = n // 2 - 1
	result = 0
	while l >= 0:
		if s[l] * 2 <= s[r]:
			result += 1
			r -= 1
		l -= 1
	print(n - result)
n = int(input())
s = sorted([int(x) for x in stdin.read().strip().split('\n')])
run(n, s)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
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 value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
a = []
n = Int()
for _ in range(n):
	a.append(Int())
a.sort()
small = a[:n // 2]
large = a[-len(small):]
ans = 0
i = 0
j = 0
while i < len(small) and j < len(large):
	if large[i] >= 2 * small[j]:
		j += 1
		ans += 1
	i += 1
print(n - ans)


from sys import stdin
n = int(input())
inp = sorted([int(x) for x in stdin.read().strip().split('\n')])
last = n - 1
middle = int(n / 2) - 1
count = 0
while last > int(n / 2) - 1 and middle > -1:
	if inp[last] >= 2 * inp[middle]:
		count += 1
		last -= 1
		middle -= 1
	else:
		middle -= 1
print(n - count)