{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eDr. Moriarty is about to send a message to Sherlock Holmes. He has a string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e. \u003c/p\u003e\u003cp\u003eString \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ep\u003c/i\u003e\u003c/span\u003e is called a \u003cspan class\u003d\"tex-font-style-it\"\u003esubstring\u003c/span\u003e of string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e if you can read it starting from some position in the string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e. For example, string \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaba\u003c/span\u003e\" has six substrings: \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eab\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eba\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaba\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eDr. Moriarty plans to take string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e and cut out some substring from it, let\u0027s call it \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e. Then he needs to \u003cspan class\u003d\"tex-font-style-underline\"\u003echange\u003c/span\u003e the substring \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e zero or more times. As a result, he should obtain a fixed string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eu\u003c/i\u003e\u003c/span\u003e (which is the string that should be sent to Sherlock Holmes). One change is defined as making one of the following actions: \u003c/p\u003e\u003cul\u003e \u003cli\u003e Insert one letter to any end of the string. \u003c/li\u003e\u003cli\u003e Delete one letter from any end of the string. \u003c/li\u003e\u003cli\u003e Change one letter into any other one. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eMoriarty is very smart and after he chooses some substring \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e, he always makes the minimal number of changes to obtain \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eu\u003c/i\u003e\u003c/span\u003e. \u003c/p\u003e\u003cp\u003eHelp Moriarty choose the best substring \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e from all substrings of the string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e. The substring \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e should minimize the number of changes Moriarty should make to obtain the string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eu\u003c/i\u003e\u003c/span\u003e from it.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a non-empty string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e, consisting of lowercase Latin letters. The second line contains a non-empty string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eu\u003c/i\u003e\u003c/span\u003e, consisting of lowercase Latin letters. The lengths of both strings are in the range from \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e2000\u003c/span\u003e, inclusive.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint the only integer — the minimum number of changes that Dr. Moriarty has to make with the string that you choose.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eaaaaa\naaa\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eabcabc\nbcd\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eabcdef\nklmnopq\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e7\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first sample Moriarty can take any substring of length \u003cspan class\u003d\"tex-span\"\u003e3\u003c/span\u003e, and it will be equal to the required message \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eu\u003c/i\u003e\u003c/span\u003e, so Moriarty won\u0027t have to make any changes.\u003c/p\u003e\u003cp\u003eIn the second sample you should take a substring consisting of characters from second to fourth (\"\u003cspan class\u003d\"tex-font-style-tt\"\u003ebca\u003c/span\u003e\") or from fifth to sixth (\"\u003cspan class\u003d\"tex-font-style-tt\"\u003ebc\u003c/span\u003e\"). Then you will only have to make one change: to change or to add the last character.\u003c/p\u003e\u003cp\u003eIn the third sample the initial string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003c/span\u003e doesn\u0027t contain any character that the message should contain, so, whatever string you choose, you will have to make at least \u003cspan class\u003d\"tex-span\"\u003e7\u003c/span\u003e changes to obtain the required message.\u003c/p\u003e"}}]}