{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ consisting of lowercase English letters. Determine whether we can turn $S$ into a palindrome by repeating the operation of swapping two adjacent characters. If it is possible, find the minimum required number of operations."},{"iden":"constraints","content":"*   $1 \\leq |S| \\leq 2 × 10^5$\n*   $S$ consists of lowercase English letters."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$S$"},{"iden":"sample input 1","content":"eel"},{"iden":"sample output 1","content":"1\n\nWe can turn $S$ into a palindrome by the following operation:\n\n*   Swap the $2$\\-nd and $3$\\-rd characters. $S$ is now `ele`."},{"iden":"sample input 2","content":"ataatmma"},{"iden":"sample output 2","content":"4\n\nWe can turn $S$ into a palindrome by the following operation:\n\n*   Swap the $5$\\-th and $6$\\-th characters. $S$ is now `ataamtma`.\n*   Swap the $4$\\-th and $5$\\-th characters. $S$ is now `atamatma`.\n*   Swap the $3$\\-rd and $4$\\-th characters. $S$ is now `atmaatma`.\n*   Swap the $2$\\-nd and $3$\\-rd characters. $S$ is now `amtaatma`."},{"iden":"sample input 3","content":"snuke"},{"iden":"sample output 3","content":"\\-1\n\nWe cannot turn $S$ into a palindrome."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}