Under construction

Still being built. Things may change

Hanbit Media (Easy)

Interview

Time limit1sMemory limit1024 MB

Summary
Given N book prices, split the books into the fewest pages so that no page holds two prices that differ by a factor of two or more.
Level

Easy3 of 10

Topics
Greedy, Sorting
Solved
No attempts yet

Problem

This problem has different input and output constraints from "Hanbit Media (Hard)".

Hanbit Media Co., Ltd. builds an IT world with books. The protagonists of the IT world are "we." Hanbit Media publishes books in many fields for IT professionals, including programming, computer science, IT essays, Make, Realtime (e-books), OA, graphics, and practical books for oneself and one's children.

Sanjini graduated from university and received a request from Hanbit Media, which has sponsored the Pusan National University programming contest since 2022. The request was to develop a book display program for a website that uses the database of books Hanbit Media has published. Sanjini gladly accepted and started developing the program. The books in the database are displayed on the website's pages according to the rules below.

  • A page on the website must display at least one kind of book.
  • Two books whose prices differ by a factor of two or more cannot be displayed on the same page. For example, a book priced 3 0003\,000 won can be displayed with a book priced 5 0005\,000 won, but not with a book priced 6 0006\,000 won.

Sanjini believes customers will have trouble finding books when many pages display them, so Sanjini decided to minimize the number of pages that display books. Help Sanjini!

Input

The first line contains an integer NN, the number of books. (1≤N≤105)(1 \leq N \leq 10^5)

The second line contains the price SiS_i of the ii-th book, separated by spaces. (103≤Si≤106)(10^3 \leq S_i \leq 10^6)

Output

Print the minimum number of pages needed to display all books.

Examples1

  1. Example 1

    Input
    3
    1000 2000 3000
    
    Expected output
    2