{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ that is a permutation of `atcoder`.  \nOn this string $S$, you will perform the following operation $0$ or more times:\n\n*   Choose two adjacent characters of $S$ and swap them.\n\nFind the minimum number of operations required to make $S$ equal `atcoder`."},{"iden":"constraints","content":"*   $S$ is a string that is a permutation of `atcoder`"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$S$"},{"iden":"sample input 1","content":"catredo"},{"iden":"sample output 1","content":"8\n\nYou can make $S$ equal `atcoder` in $8$ operations as follows:  \n`catredo` $\\rightarrow$ `[ac]tredo` $\\rightarrow$ `actre[od]` $\\rightarrow$ `actr[oe]d` $\\rightarrow$ `actro[de]` $\\rightarrow$ `act[or]de` $\\rightarrow$ `acto[dr]e` $\\rightarrow$ `a[tc]odre` $\\rightarrow$ `atcod[er]`  \nThis is the minimum number of operations achievable."},{"iden":"sample input 2","content":"atcoder"},{"iden":"sample output 2","content":"0\n\nIn this case, the string $S$ is already `atcoder`."},{"iden":"sample input 3","content":"redocta"},{"iden":"sample output 3","content":"21"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}