Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years.
×

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

C. A Colourful Prospect

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputFirecrackers scare Nian the monster, but they're wayyyyy too noisy! Maybe fireworks make a nice complement.

Little Tommy is watching a firework show. As circular shapes spread across the sky, a splendid view unfolds on the night of Lunar New Year's eve.

A wonder strikes Tommy. How many regions are formed by the circles on the sky? We consider the sky as a flat plane. A region is a connected part of the plane with positive area, whose bound consists of parts of bounds of the circles and is a curve or several curves without self-intersections, and that does not contain any curve other than its boundaries. Note that exactly one of the regions extends infinitely.

Input

The first line of input contains one integer *n* (1 ≤ *n* ≤ 3), denoting the number of circles.

The following *n* lines each contains three space-separated integers *x*, *y* and *r* ( - 10 ≤ *x*, *y* ≤ 10, 1 ≤ *r* ≤ 10), describing a circle whose center is (*x*, *y*) and the radius is *r*. No two circles have the same *x*, *y* and *r* at the same time.

Output

Print a single integer — the number of regions on the plane.

Examples

Input

3

0 0 1

2 0 1

4 0 1

Output

4

Input

3

0 0 2

3 0 2

6 0 2

Output

6

Input

3

0 0 2

2 0 2

1 1 2

Output

8

Note

For the first example,

For the second example,

For the third example,

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/26/2020 14:13:00 (e2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|