{"raw_statement":[{"iden":"problem statement","content":"Given is a string $S$ consisting of `K`, `E`, `Y`.\nHow many strings are there that can be obtained with at most $K$ swaps of two adjacent characters in $S$?"},{"iden":"constraints","content":"*   $2 \\leq |S| \\leq 30$\n*   $0 \\leq K \\leq 10^9$\n*   $S$ consists of `K`, `E`, `Y`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$S$\n$K$"},{"iden":"sample input 1","content":"KEY\n1"},{"iden":"sample output 1","content":"3\n\nWith at most one swap, there are three strings that can be obtained: `KEY`, `EKY`, `KYE`."},{"iden":"sample input 2","content":"KKEE\n2"},{"iden":"sample output 2","content":"4\n\nWith at most two swaps, there are four strings that can be obtained: `KKEE`, `KEKE`, `EKKE`, `KEEK`."},{"iden":"sample input 3","content":"KKEEYY\n1000000000"},{"iden":"sample output 3","content":"90"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}