{"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":"PLAIN","content":"给定待匹配串和模式串,求待匹配串中能分离出多少个模式串。"}},{"title":"Input","value":{"format":"PLAIN","content":"输入包含多组数据,遇到#字符则表明输入结束。\n每组数据只有一行,包含待匹配串和模式串,以空格隔开,字符集为可见的ASCII字符,长度均不大于1000。"}},{"title":"Output","value":{"format":"PLAIN","content":"每组数据输出一行结果。"}},{"title":"Sample Input","value":{"format":"PLAIN","content":"ABCD ABCD\nABABABA ABA\nCDC CDCDCDC\nKMP NAIVE\n#"}},{"title":"Sample Output","value":{"format":"PLAIN","content":"1\n2\n0\n0"}}]}