Multiple Subsequence

Given a sequence, find the longest subsequence where each element is a larger multiple of the previous one.

Medium6Dynamic programmingSortingNo attempts yetTime limit2.5sMemory limit256 MB

Problem

You are given a sequence of natural numbers. Find the length of the longest subsequence in which every element is a multiple of the element before it and strictly larger than it.

A subsequence is built by picking some elements of the original sequence without changing their order. A subsequence with one element always satisfies the condition, so the answer is never smaller than 1.

Input

The first line contains the length of the sequence NN (1N1000001 \le N \le 100000).

Each of the next NN lines contains one element of the sequence, in order. Every element is a natural number smaller than 10000001000000.

Output

Print the length of the longest subsequence that satisfies the condition on the first line.