{"trustable":false,"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":"MD","content":"Dreamoon is standing at the position $0$ on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon\u0027s smartphone and Dreamoon follows them.\n\nEach command is one of the following two types:\n\n1. Go 1 unit towards the positive direction, denoted as $\\texttt{+}$.\n2. Go 1 unit towards the negative direction, denoted as $\\texttt{-}$.\n\nBut 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 $1$ unit to the negative or positive direction with the same probability $0.5$).\n\nYou 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?"}},{"title":"Input","value":{"format":"MD","content":"The first line contains a string $s_1$ — the commands Drazil sends to Dreamoon, this string consists of only the characters in the set $\\\\{ \\texttt{+}, \\texttt{-} \\\\}$.\n\nThe second line contains a string $s_2$ — the commands Dreamoon\u0027s smartphone recognizes, this string consists of only the characters in the set $\\\\{ \\texttt{+}, \\texttt{-}, \\texttt{?} \\\\}$. $\\texttt{?}$ denotes an unrecognized command.\n\nLengths of two strings are equal and do not exceed $10$."}},{"title":"Output","value":{"format":"MD","content":"Output a single real number corresponding to the probability. The answer will be considered correct if its relative or absolute error doesn\u0027t exceed $10^{-9}$."}},{"title":"Examples","value":{"format":"MD","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":"MD","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":"MD","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":"MD","content":"For the first sample, both $s_1$ and $s_2$ will lead Dreamoon to finish at the same position $+1$. \n\nFor the second sample, $s_1$ will lead Dreamoon to finish at position $0$, while there are four possibilites for $s_2$: $\\\\{ \\texttt{+-++}, \\texttt{+-+-}, \\texttt{+--+}, \\texttt{+---} \\\\}$ with ending positions $\\\\{ +2, 0, 0, -2 \\\\}$ respectively. So there are $2$ correct cases out of $4$, so the probability of finishing at the correct position is $0.5$.\n\nFor the third sample, $s_2$ could only lead us to finish at positions $\\\\{ +1, -1, -3 \\\\}$, so the probability to finish at the correct position $+3$ is $0$."}}]}