Goblin Garden Guards

No attempts yetTime limit3sMemory limit256 MB

Problem

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.

Input

The first line contains one integer gg (1g1000001 \le g \le 100000), the number of goblins in the royal gardens.

Each of the next gg lines contains the position of one goblin as two integers xix_i and yiy_i (0xi100000 \le x_i \le 10000, 0yi100000 \le y_i \le 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 mm (1m200001 \le m \le 20000), the number of sprinklers in the garden.

Each of the next mm lines contains the position of one sprinkler and the radius of the area it covers as three integers xix_i, yiy_i and rr (0xi100000 \le x_i \le 10000, 0yi100000 \le y_i \le 10000, 1r1001 \le r \le 100). Any goblin at a distance of at most rr from the point (xi,yi)(x_i, y_i) is soaked by this sprinkler. Several sprinklers can share the same location.

Output

Print the number of goblins remaining in the garden after the sprinklers have been turned on.