{"raw_statement":[{"iden":"problem statement","content":"You are given a sequence of $N$ positive integers: $A=(A_1,A_2, \\dots A_N)$. You can do the operation below zero or more times. At least how many operations are needed to make $A$ a palindrome?\n\n*   Choose a pair $(x,y)$ of positive integers, and replace every occurrence of $x$ in $A$ with $y$.\n\nHere, we say $A$ is a palindrome if and only if $A_i=A_{N+1-i}$ holds for every $i$ ($1 \\le i \\le N$)."},{"iden":"constraints","content":"*   All values in input are integers.\n*   $1 \\le N \\le 2 \\times 10^5$\n*   $1 \\le A_i \\le 2 \\times 10^5$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$"},{"iden":"sample input 1","content":"8\n1 5 3 2 5 2 3 1"},{"iden":"sample output 1","content":"2\n\n*   Initially, we have $A=(1,5,3,2,5,2,3,1)$.\n*   After replacing every occurrence of $3$ in $A$ with $2$, we have $A=(1,5,2,2,5,2,2,1)$.\n*   After replacing every occurrence of $2$ in $A$ with $5$, we have $A=(1,5,5,5,5,5,5,1)$.\n\nIn this way, we can make $A$ a palindrome in two operations, which is the minimum needed."},{"iden":"sample input 2","content":"7\n1 2 3 4 1 2 3"},{"iden":"sample output 2","content":"1"},{"iden":"sample input 3","content":"1\n200000"},{"iden":"sample output 3","content":"0\n\n$A$ may already be a palindrome in the beginning."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}