{"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\u003eDreamoon is standing at the position \u003cspan class\u003d\"tex-span\"\u003e0\u003c/span\u003e on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon\u0027s smartphone and Dreamoon follows them.\u003c/p\u003e\u003cp\u003eEach command is one of the following two types: \u003c/p\u003e\u003col\u003e \u003cli\u003e Go 1 unit towards the positive direction, denoted as \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027+\u0027\u003c/span\u003e \u003c/li\u003e\u003cli\u003e Go 1 unit towards the negative direction, denoted as \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027-\u0027\u003c/span\u003e \u003c/li\u003e\u003c/ol\u003e\u003cp\u003eBut the Wi-Fi condition is so poor that Dreamoon\u0027s smartphone reports some of the commands can\u0027t be recognized and Dreamoon knows that some of them might even be wrong though successfully recognized. Dreamoon decides to follow every recognized command and toss a fair coin to decide those unrecognized ones (that means, he moves to the \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e unit to the negative or positive direction with the same probability \u003cspan class\u003d\"tex-span\"\u003e0.5\u003c/span\u003e). \u003c/p\u003e\u003cp\u003eYou are given an original list of commands sent by Drazil and list received by Dreamoon. What is the probability that Dreamoon ends in the position originally supposed to be final by Drazil\u0027s commands?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e\u003c/span\u003e — the commands Drazil sends to Dreamoon, this string consists of only the characters in the set {\u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027+\u0027\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027-\u0027\u003c/span\u003e}. \u003c/p\u003e\u003cp\u003eThe second line contains a string \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e\u003c/span\u003e — the commands Dreamoon\u0027s smartphone recognizes, this string consists of only the characters in the set {\u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027+\u0027\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027-\u0027\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027?\u0027\u003c/span\u003e}. \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027?\u0027\u003c/span\u003e denotes an unrecognized command.\u003c/p\u003e\u003cp\u003eLengths of two strings are equal and do not exceed \u003cspan class\u003d\"tex-span\"\u003e10\u003c/span\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput a single real number corresponding to the probability. The answer will be considered correct if its relative or absolute error doesn\u0027t exceed \u003cspan class\u003d\"tex-span\"\u003e10\u003csup class\u003d\"upper-index\"\u003e - 9\u003c/sup\u003e\u003c/span\u003e.\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\u003e++-+-\n+-+-+\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1.000000000000\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\u003e+-+-\n+-??\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0.500000000000\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\u003e+++\n??-\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0.000000000000\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\u003eFor the first sample, both \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e\u003c/span\u003e will lead Dreamoon to finish at the same position \u003cspan class\u003d\"tex-span\"\u003e + 1\u003c/span\u003e. \u003c/p\u003e\u003cp\u003eFor the second sample, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e\u003c/span\u003e will lead Dreamoon to finish at position 0, while there are four possibilites for \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e\u003c/span\u003e: {\u003cspan class\u003d\"tex-font-style-tt\"\u003e\"+-++\"\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e\"+-+-\"\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e\"+--+\"\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e\"+---\"\u003c/span\u003e} with ending position {+2, 0, 0, -2} respectively. So there are \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e correct cases out of \u003cspan class\u003d\"tex-span\"\u003e4\u003c/span\u003e, so the probability of finishing at the correct position is \u003cspan class\u003d\"tex-span\"\u003e0.5\u003c/span\u003e. \u003c/p\u003e\u003cp\u003eFor the third sample, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003es\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e\u003c/span\u003e could only lead us to finish at positions {+1, -1, -3}, so the probability to finish at the correct position \u003cspan class\u003d\"tex-span\"\u003e + 3\u003c/span\u003e is \u003cspan class\u003d\"tex-span\"\u003e0\u003c/span\u003e.\u003c/p\u003e"}}]}