SP661 QUEST5 - Nail Them
Description
To get to the treasure, **Jones** must complete one more task. He comes across a table, where there are a number of wooden planks lying along the length of the table. He notices that the width of the table is exactly equal to the width of every plank on it. The planks are so heavy that they cannot be manually moved in any way. Some of these wooden planks are overlapping. **Jones** has a hammer and the Gods grant him infinite nails. The planks have to be joined to the table with nails such that every plank is connected to the table through at least one nail. The nails are of sufficient length, and have to be hammered vertically into the table. One or more planks can be joined to the table through a single nail provided they have a common overlap. Find out the minimum number of nails he needs to nail all planks to the table.

Input Format
- The first line of the input is a positive integer **t
Output Format
The output must contain **t** lines , the **k $ ^{th} $** line corresponding to the **k $ ^{th} $** table. The output on the **k $ ^{th} $** line must be an integer **i $ _{k} $** , the minimum number of nails required.