{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou are a big fancier of jewelry and gemstones. Recently, a remarkable diamond was put for sale in the jewelry store next to your house. Unfortunately, its price was also remarkable \u0016- \u003cstrong\u003eX\u003c/strong\u003e dollars. Regretful, you had to state that this is way too much.\u003c/p\u003e\n\n\u003cp\u003eApparently, other potential buyers also came to the same conclusion, because soon the store started an advertising campaign. \"\u0010Get a \u003cstrong\u003e5\u003c/strong\u003e\\% discount on the diamond for each letter of your name!\u0011,\" read the streamer by the frontdoor. The formulation left some ambiguities, so you decided to question the sellers. As it turned out:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cp\u003e\u003cli\u003e If a letter occurs in the name several times, it\u0027s only counted once. For example, \u0010\"\u003cstrong\u003ealexandra\u003c/strong\u003e\u0011\" contains only \u003cstrong\u003e7\u003c/strong\u003e letters in terms of the campaign.\u003c/p\u003e\n\n\u003cp\u003e\u003cli\u003e \u003cstrong\u003e5\u003c/strong\u003e\\% discount is multiplied by the number of distinct letters in the name. I.e., \"\u003cstrong\u003ealexandra\u003c/strong\u003e\" would get a \u003cstrong\u003e35\u003c/strong\u003e\\% discount.\u003c/p\u003e\n\n\u003cp\u003e\u003cli\u003e The discounts exceeding \u003cstrong\u003e100\u003c/strong\u003e\\% are not provided, but a \u003cstrong\u003e100\u003c/strong\u003e\\% discount is okay (yep, the sellers questioned your sanity when they heard this inquiry).\u003c/p\u003e\n\n\u003c/ul\u003e\n\n\u003cp\u003eOf course, not making use of such a generous o\u001ber would be a crime, but maybe you can save more? By chance, you know a person who makes fake passports. His service is paid as follows: A fake passport costs \u003cstrong\u003eA\u003c/strong\u003e dollars. It may contain your real name without changes, or the name may be altered using any number of operations of the following three kinds.\u003c/p\u003e\n\n\u003cul\u003e\n\u003cp\u003e\u003cli\u003e Inserting a letter at any position in the name costs \u003cstrong\u003eB\u003c/strong\u003e dollars.\u003c/p\u003e\n\n\u003cp\u003e\u003cli\u003e Erasing a letter at any position in the name costs \u003cstrong\u003eC\u003c/strong\u003e dollars. If a name contains a single letter, erasing it is not allowed.\u003c/p\u003e\n\n\u003cp\u003e\u003cli\u003e Replacing a letter at some position with any other letter of the English alphabet costs \u003cstrong\u003eD\u003c/strong\u003e dollars.\u003c/p\u003e\n\n\u003c/ul\u003e\n\n\u003cp\u003eGiven \u003cstrong\u003eX\u003c/strong\u003e, \u003cstrong\u003eA\u003c/strong\u003e, \u003cstrong\u003eB\u003c/strong\u003e, \u003cstrong\u003eC\u003c/strong\u003e, \u003cstrong\u003eD\u003c/strong\u003e and your real \u003cstrong\u003ename\u003c/strong\u003e, determine the least amount of money which you need to obtain the diamond (count both the money spent on buying the diamond and the money spent on the fake passport, if any). Taking a fake passport is not neccessary \u0016 you may just provide your real passport at the store.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eInput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eThe fi\u001crst line of input contains integer \u003cstrong\u003eX\u003c/strong\u003e. The second line contains integers \u003cstrong\u003eA\u003c/strong\u003e, \u003cstrong\u003eB\u003c/strong\u003e, \u003cstrong\u003eC\u003c/strong\u003e and \u003cstrong\u003eD\u003c/strong\u003e (\u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003eX\u003c/strong\u003e, \u003cstrong\u003eA\u003c/strong\u003e, \u003cstrong\u003eB\u003c/strong\u003e, \u003cstrong\u003eC\u003c/strong\u003e, \u003cstrong\u003eD\u003c/strong\u003e ≤ \u003cstrong\u003e1000000\u003c/strong\u003e), separated by single spaces. The third line contains \u003cstrong\u003eName\u003c/strong\u003e. It contains from \u003cstrong\u003e1\u003c/strong\u003e to \u003cstrong\u003e15\u003c/strong\u003e characters and consists of lowercase English letters only.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eOutput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003ePrint the least amount of money you need to get the diamond, measured in cents (a dollar is \u003cstrong\u003e100\u003c/strong\u003e cents).\u003c/p\u003e\n\n"}},{"title":"Example","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\u003e100\n1 2 3 4\neldar\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3100\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}