All problems

Handling Overlapping Points With Transparency

mediumPythonMatplotlibScatter Plot

Meridian Insight is drawing a cycle-hire log: each trip is one dot, placed by where it started. Thousands of trips leave from the same few docking stations, so identical dots stack up and a solid blob forms. Drawing the dots see-through helps — stacked dots darken — but the client also wants the fact stated plainly underneath, because a shade of grey is not evidence.

Task: Print how many different starting spots were used more than once. Count each such spot once, however many trips left from it. A spot counts as the same spot only when both of its numbers match exactly.

Input

The first line holds an integer n, the number of trips. Each of the next n lines holds two numbers separated by a single space: the starting spot's two coordinates. Both may have decimals. n is at least 1.

Output

One line holding a whole number: how many spots were reused.

Example:

Input:
4
1 1
2 2
1 1
3 3

Output:
1

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…