Given a sequence A1,A2,⋯,An As for a subsequence Ab1,Ab2,⋯,Abm(1≤b1<b2<⋯<bm≤n), we say it magicalif and only if mm is even and
A
b1+A
b2= A
b3+A
b4 =⋯= A
bm−1+ A
bm. Determine the maximum length among all magical subsequences of the given sequence.
Output
Output one line containing only one integer, denoting the answer.
Note
One possible magical subsequence of length 6 is {A1=3,A5=5,A7=2,A8=6,A9=5,A10=3}.
Here 3+5=2+6=5+3=83+5=2+6=5+3=8.