Circle and Triangle#667

Circle and Triangle

1 second
64 megabytes
Hard

In a plane, there is a circle and a triangle. You need to determine the number of intersection points between them.

Input

The first line contains the coordinates of the center of the circle and its radius. The next three lines each contain the coordinates of the vertices of the triangle.

All values are integers and do not exceed in absolute value.

Output

Output a single integer — the total number of intersection points.

Examples

Example 1

Loading
Loading