Nails

The World Of Nails (WON) is a famous hardware store specialized in selling hundreds of different kinds of nails. Some of them very old, rare and expensive. However, the store also offers some standard hand tools and wood. Rado, the store’s manager, has two kids who usually go to the store after school and spend the afternoon playing with the tools. During all this time, the kids play with hammers, nails, screws, wood, etc. (quite dangerous isn’t it?). One day, the kids were playing in the wood deposit. By accident, they hit a huge pile of wood sticks which then collapsed. A lot of wood sticks fell to the floor, but did not hit any of the kids. The kids did not get scare and so they continued playing. They took a bag of very expensive nails and a hammer and decided to hammer the nails on the wood sticks, just for fun. If a wood stick were laying in top of another, they joined these two pieces together by hammering exactly one nail where they crossed, see Figure 1. No more than two stick are crossed in the same point such as shown on third configuration in figure below. If a wood stick was laying on the floor all alone, with no other stick on top of it, they hammered the stick on to the floor using two nails, one for each end of the stick. Figure 1: Different configurations After a couple of hours, Rado discovered the disaster in the deposit. When he noticed what kind of nails were the kids using, he was shocked. A lot of money wasted on a little game. Rado wants you to help him calculate how many nails did they kids use, to calculate how much money he has lost. Input The input consists in several test cases. Each case corresponds to a set of wooden sticks. The first line of a test case contains one integer (0 ≤ N ≤ 1000), indicating the number of sticks. Next, N lines follow, each one corresponding to a stick. Each line contains four integer values (0 ≤ X1, Y1, X2, Y2 ≤ 1000) separated of each other by exactly one blank space. The first two integers correspond to the Cartesian coordinates of one end of the wood stick. The later two integers correspond to the Cartesian coordinate of the other end of the wood stick. Assume no stick is completely superposed by another. The end of input is indicated by a test case with N = 0. Output For each case specified in the input, the output is a single line containing the number of nails used by the kids.

2/2 Sample Input 3 0030 1133 1222 3 0030 1100 1022 3 1122 0050 0105 0 Sample Output 3 2 6