A set of distinct integers is given. Find the length of the longest sequence of Fibonacci numbers that can be arranged from them. Each number can be used in the sequence no more than once. The sequence F is called the Fibonacci sequence, if
F[1]
= a
F[2]
= b
F[i]
= F[i–2]
+ F[i–1]
The first line contains the number n (2 ≤ n ≤ 10000) of elements in the set. The second line contains n distinct integers a[i]
(1 ≤ a[i]
≤ 10^9
).
Print the length of the longest Fibonacci sequence, that can be created from given numbers.