{"raw_statement":[{"iden":"problem statement","content":"You are given an integer sequence of length $N$, $A=(A_1, A_2, \\cdots, A_N)$. Snuke wants to make $A$ a non-decreasing sequence.\nHe can perform the following operation zero or more times.\n\n*   Choose two adjacent elements of $A$\n*   Remove these two elements and insert the bitwise $\\mathrm{OR}$ of these two values at the original position\n\nFind the maximum possible value of the length of $A$ when $A$ becomes a non-decreasing sequence.\nWhat is bitwise $\\mathrm{OR}$?The bitwise $\\mathrm{OR}$ of non-negative integers $A$ and $B$, $A\\ \\mathrm{OR}\\ B$, is defined as follows.\n\n*   When $A\\ \\mathrm{OR}\\ B$ is written in binary, the digit in the $2^k$ place ($k \\geq 0$) is $1$ if at least one of the digits in the $2^k$ place of $A$ and $B$ written in binary is $1$, and $0$ otherwise.\n\nFor example, $3\\ \\mathrm{OR}\\ 5 = 7$ (in binary: $011\\ \\mathrm{OR}\\ 101 = 111$).\n\nWhat is a non-decreasing sequence?A sequence $a=(a_1,a_2, \\cdots, a_n)$ is a non-decreasing sequence if and only if $a_1 \\le a_2 \\le \\ldots \\le a_n$ holds."},{"iden":"constraints","content":"*   $1 \\le N \\le 2 \\times 10^5$\n*   $1 \\le A_i <2^{30}$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$"},{"iden":"sample input 1","content":"3\n3 1 2"},{"iden":"sample output 1","content":"2\n\n*   If the $1$\\-st and $2$\\-nd elements are chosen in the first operation, $A=(3,2)$ and $A$ is not a non-decreasing sequence.\n*   If the $2$\\-nd and $3$\\-rd elements are chosen in the first operation, $A=(3,3)$ and $A$ is a non-decreasing sequence."},{"iden":"sample input 2","content":"4\n4 1 2 3"},{"iden":"sample output 2","content":"1"},{"iden":"sample input 3","content":"20\n105327673 847116534 928167271 478716741 244808645 744985167 772409400 950055714 32441819 24475691 74630537 632066724 170250355 937572655 791196964 469960355 264764288 1061830134 183233398 643628719"},{"iden":"sample output 3","content":"7"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}