{"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":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n \u003cbr\u003eSummer vacation is coming and there are more competitions to attend.\n \u003cbr\u003ebigbigfish is a active ACMer,So he wants to take part in as many competitions as possible.suppose you already know all the arrangements for the competition,Can you arrange it properly?(The aim is to participate as much as possible entire compititong)\n \u003cbr\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are multiple test cases. Each case contains a positive integer N(n\u0026lt;\u003d100)express total number of games ,followed by N positive numbers,Each line includes two number Ti_s,Ti_e (1\u0026lt;\u003di\u0026lt;\u003dn),Representing the ith the start and end time of the competitions ,n\u003d0 Indicates the end of input and no processing\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output the total number of competition that can be attend , one line for each test case"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e12\n1 3\n3 4\n0 7\n3 8\n15 19\n15 20\n10 15\n8 18\n6 12\n5 10\n4 14\n2 9\n0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e5\u003c/pre\u003e"}}]}