{"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":"HTML","content":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003eSajid achieved pupil(green) in codeforces contest rating. Now, he has to treat some of his friends. So, Sajid planned to buy some ice cream at the local ice cream parlor Sub Zero. There are \u003cb\u003en\u003c/b\u003e ice cream in Sub Zero, the \u003ci\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/i\u003e ice cream costs \u003ci\u003ec\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e taka.\u003c/p\u003e\n\u003cp\u003eSajid has \u003cb\u003em\u003c/b\u003e notes in his wallet, the \u003ci\u003ej\u003csup\u003eth\u003c/sup\u003e\u003c/i\u003e note has value \u003ci\u003ea\u003csub\u003ej\u003c/sub\u003e\u003c/i\u003e.\u003c/p\u003e\n\u003cp\u003eIce cream in the parlor are ordered from left to right, Sajid tries to buy \u003cspan class\u003d\"tex-font-style-it\"\u003eevery\u003c/span\u003e ice cream in that order.\u003c/p\u003e\n\u003cp\u003eWhen Sajid is at the position \u003cb\u003e\u003ci\u003ei\u003c/i\u003e\u003c/b\u003e in the parlor, he takes the first note from his wallet (if his wallet is empty then he proceeds to the next position immediately) and tries to buy the\u003ci\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/i\u003e ice cream using this note. After Sajid tried to buy the \u003ci\u003en\u003csup\u003eth\u003c/sup\u003e\u003c/i\u003e ice cream, he leaves the parlor.\u003c/p\u003e\n\u003cp\u003eSajid can buy the \u003ci\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/i\u003e ice cream if and only if the value of the first note (which he takes) from his wallet is greater or equal to the cost of the \u003ci\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/i\u003e ice cream. If he successfully buys the \u003ci\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/i\u003e ice cream, the first note from his wallet disappears and the next notes becomes first. Otherwise Sajid leaves the first note in his wallet \u003cspan class\u003d\"tex-font-style-bf\"\u003e(this note still remains the first one)\u003c/span\u003e and proceeds to the next ice cream.\u003c/p\u003e\n\u003cp\u003eYour task is to get the number of ice cream Sajid will buy.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains two integers \u003cb\u003en\u003c/b\u003e and \u003cb\u003em (1 \u003c n,m \u003c 1000)\u003c/b\u003e — the number of ice cream and the number of notes in Sajid\u0027s wallet.\u003c/p\u003e\n\u003cp\u003eThe second line of the input contains n integers \u003cb\u003ec\u003csub\u003e1\u003c/sub\u003e, c\u003csub\u003e2\u003c/sub\u003e, ... , c\u003csub\u003en\u003c/sub\u003e (1 \u003c c\u003csub\u003ei\u003c/sub\u003e \u003c 1000)\u003c/b\u003e, where \u003cb\u003ec\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e is the cost of the \u003ci\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/i\u003e ice cream.\u003c/p\u003e\n\u003cp\u003eThe third line of the input contains \u003cb\u003em\u003c/b\u003e integers \u003cb\u003ea\u003csub\u003e1\u003c/sub\u003e, a\u003csub\u003e2\u003c/sub\u003e, ... , a\u003csub\u003em\u003c/sub\u003e (1 \u003c a\u003csub\u003ej\u003c/sub\u003e \u003c 1000)\u003c/b\u003e, where \u003cb\u003ea\u003csub\u003ej\u003c/sub\u003e\u003c/b\u003e is the value of the \u003ci\u003ej\u003csup\u003eth\u003c/sup\u003e\u003c/i\u003e note from the Sajid\u0027s wallet.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint a single integer — the number of ice cream Sajid will buy.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5 4\u003cbr\u003e3 5 6 1 4\u003cbr\u003e5 3 4 6\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e3\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5 2\u003cbr\u003e20 40 50 20 40\u003cbr\u003e19 20\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e0\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e6 4\u003cbr\u003e4 8 15 16 23 42\u003cbr\u003e9999 1000 1000 999\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e4\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example Sajid buys the first ice cream using the first note (its value is 5), the note disappears, after that the second note (with value 3) becomes the first one in Sajid\u0027s wallet, then Sajid doesn\u0027t buy the second ice cream because \u003cb\u003ec\u003csub\u003e2\u003c/sub\u003e \u003e a\u003csub\u003e2\u003c/sub\u003e\u003c/b\u003e, the same with the third ice cream, then he buys the fourth ice cream using the note of value \u003cb\u003ea\u003csub\u003e2\u003c/sub\u003e\u003c/b\u003e (the third note becomes the first one in Sajid\u0027s wallet) and buys the fifth ice cream using the note of value \u003cb\u003ea\u003csub\u003e3\u003c/sub\u003e\u003c/b\u003e.\u003c/p\u003e\n\u003cp\u003eIn the second example Sajid cannot buy any ice cream because the value of the first note in his wallet is smaller than the cost of any ice cream in the parlor.\u003c/p\u003e\n\u003cp\u003eIn the third example the values of the notes in Sajid\u0027s wallet are large enough to buy ice cream he encounter until he runs out of notes in his wallet.\u003c/p\u003e"}}]}