{"trustable":false,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e\n You, a part-time dining service worker in your college’s dining hall, are now confused with a new problem: serve as many people as possible.\n \u003cbr\u003e The issue comes up as people in your college are more and more difficult to serve with meal: They eat only some certain kinds of food and drink, and with requirement unsatisfied, go away directly.\n \u003cbr\u003e You have prepared F (1 \u0026lt;\u003d F \u0026lt;\u003d 200) kinds of food and D (1 \u0026lt;\u003d D \u0026lt;\u003d 200) kinds of drink. Each kind of food or drink has certain amount, that is, how many people could this food or drink serve. Besides, You know there’re N (1 \u0026lt;\u003d N \u0026lt;\u003d 200) people and you too can tell people’s personal preference for food and drink.\n \u003cbr\u003e Back to your goal: to serve as many people as possible. So you must decide a plan where some people are served while requirements of the rest of them are unmet. You should notice that, when one’s requirement is unmet, he/she would just go away, refusing any service.\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv\u003e\n There are several test cases.\n \u003cbr\u003e For each test case, the first line contains three numbers: N,F,D, denoting the number of people, food, and drink.\n \u003cbr\u003e The second line contains F integers, the \n \u003cspan\u003eith\u003c/span\u003e number of which denotes amount of representative food.\n \u003cbr\u003e The third line contains D integers, the \n \u003cspan\u003eith\u003c/span\u003e number of which denotes amount of representative drink.\n \u003cbr\u003e Following is N line, each consisting of a string of length F. \u0026nbsp;The \n \u003cspan\u003ejth\u003c/span\u003e character in the \n \u003cspan\u003e\u003cstrong\u003ei\u003c/strong\u003eth\u003c/span\u003e one of these lines denotes whether people i would accept food j. “Y” for yes and “N” for no.\n \u003cbr\u003e Following is N line, each consisting of a string of length D. The \n \u003cspan\u003ejth\u003c/span\u003e character in the \n \u003cspan\u003e\u003cstrong\u003ei\u003c/strong\u003eth\u003c/span\u003e one of these lines denotes whether people i would accept drink j. “Y” for yes and “N” for no.\n \u003cbr\u003e Please process until \n \u003cspan\u003eEOF\u003c/span\u003e (End Of File).\n\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv\u003e\n For each test case, please print a single line with one integer, the maximum number of people to be satisfied.\n\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cdiv\u003e \n \u003cpre\u003e\r\n\t\u003c/pre\u003e \n \u003cdiv\u003e \n \u003cpre\u003e\r\n\t\t4 3 3\r\n1 1 1\r\n1 1 1\r\n\u003cspan\u003eYYN\u003c/span\u003e\r\n\u003cspan\u003eNYY\u003c/span\u003e\r\n\u003cspan\u003eYNY\u003c/span\u003e\r\n\u003cspan\u003eYNY\u003c/span\u003e\r\n\u003cspan\u003eYNY\u003c/span\u003e\r\n\u003cspan\u003eYYN\u003c/span\u003e\r\n\u003cspan\u003eYYN\u003c/span\u003e\r\n\u003cspan\u003eNNY\u003c/span\u003e \u003c/pre\u003e \n \u003c/div\u003e \n\u003c/div\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cdiv\u003e \n \u003cpre\u003e\r\n\t\u003c/pre\u003e \n \u003cdiv\u003e \n \u003cpre\u003e\r\n\t\t3 \u003c/pre\u003e \n \u003c/div\u003e \n\u003c/div\u003e"}}]}