{"problem":{"name":"offence","description":{"content":"You are given a string $S$. Find the minimum length of a string that can be obtained by performing the following operation on the string $S$ zero or more times. *   Choose a contiguous occurrence of ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc325_g"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$. Find the minimum length of a string that can be obtained by performing the following operation on the string $S$ zero or more times.\n\n*   Choose a contiguous occurrence of `of` in the string and an integer $i$ between $0$ and $K$, inclusive. Then, remove the `of` and the following $i$ characters from the string.\n\n## Constraints\n\n*   $0 \\leq K < |S| \\leq 300$\n*   $K$ is an integer.\n*   $S$ is a string consisting of lowercase English letters.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$S$\n$K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc325_g","tags":[],"sample_group":[["keyofscience\n3","7\n\nBy choosing the `of` formed by the fourth and fifth characters and setting $i = 3$, you can remove `ofsci` from `keyofscience` and get `keyence`.  \nIt is impossible to reduce the length of the string to $6$ or less by repeating the operation, so the answer is $7$."],["oofsifffence\n3","2"],["ooofff\n5","0"],["okeyencef\n4","9"]],"created_at":"2026-03-03 11:01:14"}}