{"trustable":true,"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 class\u003d\"panel_content\"\u003e 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.\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.\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.\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.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":" There are several test cases.\u003cbr\u003e For each test case, the first line contains three numbers: N,F,D, denoting the number of people, food, and drink.\u003cbr\u003e The second line contains F integers, the ith number of which denotes amount of representative food.\u003cbr\u003e The third line contains D integers, the ith number of which denotes amount of representative drink.\u003cbr\u003e Following is N line, each consisting of a string of length F. e jth character in the ith one of these lines denotes whether people i would accept food j. “Y” for yes and “N” for no.\u003cbr\u003e Following is N line, each consisting of a string of length D. e jth character in the ith one of these lines denotes whether people i would accept drink j. “Y” for yes and “N” for no.\u003cbr\u003e Please process until EOF (End Of File).\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":" For each test case, please print a single line with one integer, the maximum number of people to be satisfied.\u003cbr\u003e"}},{"title":"Sample","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\u003e4 3 3\r\n1 1 1\r\n1 1 1\r\nYYN\r\nNYY\r\nYNY\r\nYNY\r\nYNY\r\nYYN\r\nYYN\r\nNNY\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}