A Look at the Sky#4061

A Look at the Sky

0.4 seconds
16 megabytes
Very easy

A telescope is positioned at a specific point in space to observe stars. It can "see" stars located within a sector defined by an opening angle relative to its "view" direction, and at a distance no greater than . This means the telescope's "view" forms a cone with a spherical base (refer to the illustration in the example).

Your task is to determine how many stars the telescope can "see," based on the telescope's position, its "view" direction, and the stars' locations.

Notes:

Input

The first line contains two integers and , separated by a space, representing the opening angle and the "view" distance (10° \le A \le 45°; 1 \le L \le 100).

The second line contains three integers x_t, y_t, z_t, separated by spaces, which are the coordinates of the telescope's position (0 \le x_t, y_t, z_t \le 100).

The third line contains three integers x_v, y_v, z_v, separated by spaces, representing the coordinates of the telescope's "view" direction (0 \le x_v, y_v, z_v \le 100).

The fourth line contains one integer , the number of stars (1 \le n \le 10000).

Each of the following lines contains the coordinates of the -th star, given as three integers x_i, y_i, z_i, separated by spaces (0 \le x_i, y_i, z_i \le 100).

Output

The output should be a single integer, indicating the number of stars that the telescope "sees."

Examples

Example 1

Loading
Loading