Some of you may know when a snail crawls; he will leave a spoor after his tour. Then all of you will know that when many snail crawls, they will leave many spoors. In this problem, you will be given n snails’ spoors, then calculate the sum of length of their spoors. To make it harder, we assume that all the snail crawl on the same line. That is to say, when two snails’ spoor overlaps, the length of the overlap part is considered only once.