The greatest sequence multiple subsequence
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given a numeric sequence , you need to find the length of the longest divisible subsequence.
For a divisible subsequence (), the condition holds true for (the statement means is divisible by ). A subsequence with one element is considered divisible by definition.
Input
The first line of the input file contains a single natural number () — the number of elements in the given sequence. The next line contains integers, each of absolute value not exceeding , which form the sequence.
Output
Output a single number equal to the desired length.
Examples
Input #1
Answer #1
Submissions 4K
Acceptance rate 17%