Chang loves solving mathematical puzzles. One day he was solving a puzzle. According to the problem statement of the puzzle: "there are N integers. you are asked to delete some numbers such that the series obtained after deletion follows the condition. 
(condition/equation): a - 3b ≤ 0 where a is the maximum and b is the minimum of the series obtained after deletion is done. This condition/equation must be followed by the series of numbers obtained by deleting some numbers from original series of numbers".
The question asks to tell the mininium number of integers to be deleted so that the above condition is followed by the remaining numbers obtained after deletion. Help chang in solving this mathematical brainbuster.

INPUT

The first line contain number of integers "N".The second line contains those N integers.

OUTPUT

output a single integer ie.the minimum number of integers needed to be removed to follow the condition.

Constraint

1 ≤ N ≤ 10^4
1 ≤ input number ≤ 10^4  

SAMPLE INPUT
3
1 2 4

SAMPLE OUTPUT
1

Explanation

here if we remove 4 from the series.Then we will be left with 1 and 2
which satisfies the condition a-3b ≤ 0
so the answer will be 1.
# your code goes here
N=input()
a=[]
hash=[0]*10005
a=map(int,raw_input().split())
for i in a:
	hash[i]+=1
sum=0
for i in range(0,10005):
	sum+=hash[i]
	hash[i]=sum
a.sort()
ans=1000000
for i in range(1,a[N-1]):
	if(3*i<10004):
		ans=min(ans,N-(hash[3*i]-hash[i-1]))
print ans