Goblins have invaded the Nedewsian city of Mlohkcots. Goblins are small, green critters, and nothing pleases them more than adding entropy to the calm and ordered lives of ordinary people. They fear very little, but they do fear water.
The invasion has reached the royal gardens. The goblins steal fruit, take the lawnmower for joyrides and carve the trees into obscene shapes, and King Lrac Fatsug has decreed that the nonsense stop immediately.
The garden has an automated sprinkler system. Turning the sprinklers on soaks every goblin within range, and a soaked goblin runs home to dry off.
You serve in the royal garden guards. Count how many goblins are still in the garden after the sprinklers have been turned on, so that the royal gardeners can plan their next move.
The first line contains one integer g (1≤g≤100000), the number of goblins in the royal gardens.
Each of the next g lines contains the position of one goblin as two integers xi and yi (0≤xi≤10000, 0≤yi≤10000). The garden is flat and square, and all distances are in meters. Because of quantum interference, several goblins can occupy exactly the same spot in the garden.
The next line contains one integer m (1≤m≤20000), the number of sprinklers in the garden.
Each of the next m lines contains the position of one sprinkler and the radius of the area it covers as three integers xi, yi and r (0≤xi≤10000, 0≤yi≤10000, 1≤r≤100). Any goblin at a distance of at most r from the point (xi,yi) is soaked by this sprinkler. Several sprinklers can share the same location.
Print the number of goblins remaining in the garden after the sprinklers have been turned on.