{"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":"Nasa decided in the next month they will check out some space anomalies they picked on their radar in our galaxy. However, Nasa doesn\u0027t have enough astronauts so they started a training program. Every time astronaut(s) are ready a positive number will be given. And every time a space anomaly will be discovered a negative number will be given. Count how many space anomalies will go unchecked if Nasa started without any astronauts.\n\u003cbr\u003e\n\u003cstrong\u003eNOTE:\u003c/strong\u003e each astronaut gets to check an anomaly only once. \u003cbr\u003e\n\u003cstrong\u003e Anomaly means some event happened that is not normal\u003c/strong\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line: integer \u003cI\u003en\u003c/I\u003e which indicates the number of anomalies discovered and trainees ready to fly. \u003cbr\u003e\n\u003cbr\u003e\nThe second line: \u003cI\u003en\u003c/I\u003e separated integers; -1 means an anomaly has been discovered and any positive number means number of trainees are ready to fly and check out the anomaly. No more than 10 trainees will be ready at a time."}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint a single integer, the number of anomalies which will go unchecked.\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\u003e3\u003cbr\u003e-1 -1 1\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\u003e2\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\u003e8\u003cbr\u003e1 -1 1 -1 -1 1 1 1\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\u003e1\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\u003e11\u003cbr\u003e-1 -1 2 -1 -1 -1 -1 -1 -1 -1 -1\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\u003e8\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eLets consider the second example:\u003c/p\u003e\n\u003col\u003e \n \u003cli\u003e Firstly one trainee is ready. \u003c/li\u003e\n \u003cli\u003e Then an anomaly is discovered, the last trainee will check this anomaly. \u003c/li\u003e\n \u003cli\u003e One more trainee is ready. \u003c/li\u003e\n \u003cli\u003e One more anomaly is discovered, the last trainee will check this anomaly. \u003c/li\u003e\n \u003cli\u003e Anomaly is discovered. There is no trainees ready at the time, so this anomaly will go unchecked. \u003c/li\u003e\n \u003cli\u003e One more trainee is ready. \u003c/li\u003e\n \u003cli\u003e One more trainee is ready. \u003c/li\u003e\n \u003cli\u003e One more trainee is ready. \u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eThe answer is one, as one anomaly (on step 5) will go unchecked.\u003c/p\u003e"}}]}