{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou\u0027ve got a string $$$a_1, a_2, \\dots, a_n$$$, consisting of zeros and ones.\u003c/p\u003e\u003cp\u003eLet\u0027s call a sequence of consecutive elements $$$a_i, a_{i + 1}, \\ldots, a_j$$$ ($$$1\\leq i\\leq j\\leq n$$$) a \u003cspan class\u003d\"tex-font-style-it\"\u003esubstring\u003c/span\u003e of string $$$a$$$. \u003c/p\u003e\u003cp\u003eYou can apply the following operations any number of times:\u003c/p\u003e\u003cul\u003e \u003cli\u003e Choose some substring of string $$$a$$$ (for example, you can choose entire string) and reverse it, paying $$$x$$$ coins for it (for example, «\u003cspan class\u003d\"tex-font-style-tt\"\u003e01\u003cspan class\u003d\"tex-font-style-underline\"\u003e011\u003c/span\u003e01\u003c/span\u003e» $$$\\to$$$ «\u003cspan class\u003d\"tex-font-style-tt\"\u003e01\u003cspan class\u003d\"tex-font-style-underline\"\u003e110\u003c/span\u003e01\u003c/span\u003e»); \u003c/li\u003e\u003cli\u003e Choose some substring of string $$$a$$$ (for example, you can choose entire string or just one symbol) and replace each symbol to the opposite one (zeros are replaced by ones, and ones\u0026nbsp;— by zeros), paying $$$y$$$ coins for it (for example, «\u003cspan class\u003d\"tex-font-style-tt\"\u003e01\u003cspan class\u003d\"tex-font-style-underline\"\u003e011\u003c/span\u003e01\u003c/span\u003e» $$$\\to$$$ «\u003cspan class\u003d\"tex-font-style-tt\"\u003e01\u003cspan class\u003d\"tex-font-style-underline\"\u003e100\u003c/span\u003e01\u003c/span\u003e»). \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eYou can apply these operations in any order. It is allowed to apply the operations multiple times to the same substring.\u003c/p\u003e\u003cp\u003eWhat is the minimum number of coins you need to spend to get a string consisting only of ones?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of input contains integers $$$n$$$, $$$x$$$ and $$$y$$$ ($$$1 \\leq n \\leq 300\\,000, 0 \\leq x, y \\leq 10^9$$$)\u0026nbsp;— length of the string, cost of the first operation (substring reverse) and cost of the second operation (inverting all elements of substring).\u003c/p\u003e\u003cp\u003eThe second line contains the string $$$a$$$ of length $$$n$$$, consisting of zeros and ones.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint a single integer\u0026nbsp;— the minimum total cost of operations you need to spend to get a string consisting only of ones. Print $$$0$$$, if you do not need to perform any operations.\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\u003e5 1 10\n01000\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e11\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\u003e5 10 1\n01000\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\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\u003e7 2 3\n1111111\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":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first sample, at first you need to reverse substring $$$[1 \\dots 2]$$$, and then you need to invert substring $$$[2 \\dots 5]$$$. \u003c/p\u003e\u003cp\u003eThen the string was changed as follows:\u003c/p\u003e\u003cp\u003e«\u003cspan class\u003d\"tex-font-style-tt\"\u003e01000\u003c/span\u003e» $$$\\to$$$ «\u003cspan class\u003d\"tex-font-style-tt\"\u003e10000\u003c/span\u003e» $$$\\to$$$ «\u003cspan class\u003d\"tex-font-style-tt\"\u003e11111\u003c/span\u003e».\u003c/p\u003e\u003cp\u003eThe total cost of operations is $$$1 + 10 \u003d 11$$$.\u003c/p\u003e\u003cp\u003eIn the second sample, at first you need to invert substring $$$[1 \\dots 1]$$$, and then you need to invert substring $$$[3 \\dots 5]$$$. \u003c/p\u003e\u003cp\u003eThen the string was changed as follows:\u003c/p\u003e\u003cp\u003e«\u003cspan class\u003d\"tex-font-style-tt\"\u003e01000\u003c/span\u003e» $$$\\to$$$ «\u003cspan class\u003d\"tex-font-style-tt\"\u003e11000\u003c/span\u003e» $$$\\to$$$ «\u003cspan class\u003d\"tex-font-style-tt\"\u003e11111\u003c/span\u003e».\u003c/p\u003e\u003cp\u003eThe overall cost is $$$1 + 1 \u003d 2$$$.\u003c/p\u003e\u003cp\u003eIn the third example, string already consists only of ones, so the answer is $$$0$$$.\u003c/p\u003e"}}]}