{"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\"Not solving algorithm problems this summer vacation?\"\u003cbr\u003e\"That\u0027s right.\"\u003cbr\u003e\"Then what are you doing?\"\u003cbr\u003e\"Watching the World Cup, you fool!\"\u003cbr\u003e\"@#$%^\u0026amp;*%...\"\u003cbr\u003e\u003cbr\u003eIndeed, the World Cup is here, the festival for football fans has arrived. It is estimated that many ACMers will abandon their computers and rush to the TV.\u003cbr\u003eAs a football fan, you must want to watch as many complete matches as possible. Of course, as a good young person of the new era, you will also watch some other programs, such as the news broadcast (never forget to care about national affairs), \"Happy Camp\", \"Super Girl\", and Wang Xiaoya\u0027s \"Happy Dictionary\", etc. Assuming you already know the broadcast schedule of all the TV programs you like to watch, will you arrange your time reasonably? (The goal is to watch as many complete programs as possible)\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input contains multiple test cases. The first line of each test case contains only one integer n (n\u0026lt;\u003d100), indicating the total number of programs you like to watch. Then there are n lines of data, each line includes two data Ti_s, Ti_e (1\u0026lt;\u003di\u0026lt;\u003dn), representing the start and end time of the i-th program. To simplify the problem, each time is represented by a positive integer. n\u003d0 indicates the end of input and should not be processed.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output the number of TV programs you can watch completely. Each test case\u0027s output occupies one line."}},{"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\u003e12\r\n1 3\r\n3 4\r\n0 7\r\n3 8\r\n15 19\r\n15 20\r\n10 15\r\n8 18\r\n6 12\r\n5 10\r\n4 14\r\n2 9\r\n0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}