{"trustable":true,"sections":[{"title":"Background","value":{"format":"MD","content":"After pacifying the north, Cao Cao led a large army south in 208 AD to attack Liu Biao. Before his troops even reached Jingzhou, Liu Biao had already passed away due to illness. His son, Liu Cong, upon hearing the mighty sound of Cao\u0027s army, got scared and sent someone to surrender.\n\nSun Quan appointed Zhou Yu as the commander and allocated 30,000 naval forces to him, instructing him to join forces with Liu Bei to resist Cao Cao.\n\nIn the deep winter of November, the weather suddenly turned warm and a southeast wind began to blow.\n\nUnexpectedly, the Eastern Wu fleet had only traveled about two miles from the north bank when ten large ships in front suddenly caught fire simultaneously. Fueled by the wind, the fire gained strength. Like ten fire dragons, the ten burning ships broke into Cao\u0027s naval camp. The ships there were all crowded together and unable to escape, and soon they were all engulfed in flames, turning into a sea of fire in the blink of an eye.\n\nFurious, Cao Cao summons you to dive into the sea of fire and calculate the total length of the burning ships on the line of fire!"}},{"title":"Description","value":{"format":"MD","content":"Given the start and end points of each burning section, please calculate the sum of the lengths of the burning positions."}},{"title":"Input","value":{"format":"MD","content":"The first line contains an integer, indicating the number of pieces of burning information $n$.\u003cbr\u003e\nThe next $n$ lines each contain two integers $a, b$, representing the start and end points of a burning position (**Note: Inclusive start, exclusive end**)."}},{"title":"Output","value":{"format":"MD","content":"Output a single integer representing the answer."}},{"title":"Sample 1","value":{"format":"MD","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\u003e3\n-1 1\n5 11\n2 9\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e11\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Hint","value":{"format":"MD","content":"### Constraints\n\nFor all test cases, it is guaranteed that $1 \\leq n \\leq 2 \\times 10^4$, $-2^{31} \\leq a \\leq b \\lt 2^{31}$, and the answer is less than $2^{31}$."}}]}