AT_abc388_e [ABC388E] Simultaneous Kagamimochi

Description

There are $ N $ mochi (rice cakes), arranged in ascending order of size. The size of the $ i $ -th mochi $ (1\leq i\leq N) $ is $ A_i $ . Given two mochi $ A $ and $ B $ , with sizes $ a $ and $ b $ respectively, you can make one kagamimochi (a stacked rice cake) by placing mochi $ A $ on top of mochi $ B $ if and only if $ a $ is at most half of $ b $ . Find how many kagamimochi can be made simultaneously. More precisely, find the maximum non-negative integer $ K $ for which the following is possible: - From the $ N $ mochi, choose $ 2K $ of them to form $ K $ pairs. For each pair, place one mochi on top of the other, to make $ K $ kagamimochi.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ A_1 $ $ A_2 $ $ \dotsc $ $ A_N $

Output Format

Print the maximum $ K $ such that $ K $ kagamimochi can be made simultaneously.

Explanation/Hint

### Sample Explanation 1 The sizes of the given mochi are as follows: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc388_e/25023d2ef36b419bf19ba295ed608069250993057c60435e90a9955b6411b54c.png) In this case, you can make the following three kagamimochi simultaneously: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc388_e/c34b3a374fbe12dad7d664a96ecdee4a7d1de8815c91fc7af416082f2edcaa92.png) It is not possible to make four or more kagamimochi from six mochi, so print `3`. ### Sample Explanation 2 It is possible that you cannot make any kagamimochi. ### Constraints - $ 2 \leq N \leq 5 \times 10^5 $ - $ 1 \leq A_i \leq 10^9 \ (1 \leq i \leq N) $ - $ A_i \leq A_{i+1} \ (1 \leq i < N) $ - All input values are integers.