Problem: The crowdedness of the discotheque would never stop our friends from having fun, but a bit more spaciousness won't hurt, will it?

The discotheque can be seen as an infinite xy-plane, in which there are a total of n dancers. Once someone starts moving around, they will move only inside their own movement range, which is a circular area Ci described by a center (xi, yi) and a radius ri. No two ranges' borders have more than one common point, that is for every pair (i, j) (1 ≤ i < j ≤ n) either ranges Ci and Cj are disjoint, or one of them is a subset of the other. Note that it's possible that two ranges' borders share a single common point, but no two dancers have exactly the same ranges.

Tsukihi, being one of them, defines the spaciousness to be the area covered by an odd number of movement ranges of dancers who are moving. An example is shown below, with shaded regions representing the spaciousness if everyone moves at the same time.

<image>

But no one keeps moving for the whole night after all, so the whole night's time is divided into two halves — before midnight and after midnight. Every dancer moves around in one half, while sitting down with friends in the other. The spaciousness of two halves are calculated separately and their sum should, of course, be as large as possible. The following figure shows an optimal solution to the example above.

<image>

By different plans of who dances in the first half and who does in the other, different sums of spaciousness over two halves are achieved. You are to find the largest achievable value of this sum.

Input

The first line of input contains a positive integer n (1 ≤ n ≤ 1 000) — the number of dancers.

The following n lines each describes a dancer: the i-th line among them contains three space-separated integers xi, yi and ri ( - 106 ≤ xi, yi ≤ 106, 1 ≤ ri ≤ 106), describing a circular movement range centered at (xi, yi) with radius ri.

Output

Output one decimal number — the largest achievable sum of spaciousness over two halves of the night.

The output is considered correct if it has a relative or absolute error of at most 10 - 9. Formally, let your answer be a, and the jury's answer be b. Your answer is considered correct if <image>.

Examples

Input

5
2 1 6
0 4 1
2 -1 3
1 -2 1
4 -1 1


Output

138.23007676


Input

8
0 0 1
0 0 2
0 0 3
0 0 4
0 0 5
0 0 6
0 0 7
0 0 8


Output

289.02652413

Note

The first sample corresponds to the illustrations in the legend.

Solution (in JAVA):

Solution:

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

public class CF4182 {
	static long N;
	static int MOD = (int) (1e9 + 7);
	static long fac[], ifac[];

	public static void main(String args[]) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int t = 1;
		while (t-- > 0) {
			int n = in.nextInt();
			Node a[] = new Node[n];
			for (int i = 0; i < n; i++) {
				a[i] = new Node(in.nextLong(), in.nextLong(), in.nextLong());
			}
			Arrays.sort(a);
			double pi = Math.PI;
			double dp[][] = new double[n + 1][2];
			long ind[] = new long[n + 1];
			dp[n - 1][0] = pi * a[n - 1].r * a[n - 1].r;
			ind[n - 1] = 1;

			for (int i = n - 2; i >= 0; i--) {
				int val = 1;
				dp[i][0] = dp[i + 1][0];
				dp[i][1] = dp[i + 1][1];

				long curr = 0;
				for (int j = i; j <= n; j++) {
					if (ind[j] == val) {
						long dist = dist(a[i], a[j]);
						if (dist < (a[i].r + a[j].r) * (a[i].r + a[j].r)) {
							curr++;
						}
					}
				}
				if (curr % 2 == 0) {
					dp[i][0] = dp[i + 1][0] + pi * a[i].r * a[i].r;
					ind[i] = 1;
					continue;
				}

				val = 2;
				long curr2 = 0;
				for (int j = i; j <= n; j++) {
					if (ind[j] == val) {
						long dist = dist(a[i], a[j]);
						if (dist < (a[i].r + a[j].r) * (a[i].r + a[j].r)) {
							curr2++;
						}
					}
				}
				if (curr2 % 2 == 0) {
					dp[i][1] = dp[i + 1][1] + pi * a[i].r * a[i].r;
					ind[i] = 2;
					continue;
				}

				dp[i][0] = dp[i + 1][0] - pi * a[i].r * a[i].r;
				ind[i] = 1;

			}

			System.out.printf("%.8f", dp[0][0] + dp[0][1]);
		}
		out.close();

	}

	static long dist(Node a, Node b) {

		return ((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y));
	}

	static void rand(long a[]) {
		int n = a.length;
		for (int i = 0; i < n; i++) {
			Random r = new Random();
			int j = r.nextInt(n);
			long temp = a[j];
			a[j] = a[i];
			a[i] = temp;
		}

	}

	static long mp(long a, long b) {
		long ans = 1;

		while (b != 0) {
			if (b % 2 == 1)
				ans = (ans * a) % MOD;

			a = (a * a) % MOD;
			b /= 2;

		}
		return ans % MOD;
	}

	static class DisjointSet {
		int[] rank, parent;
		int n;
		int comp;

		DisjointSet(int n) {
			rank = new int[n];
			parent = new int[n];
			this.n = n;
			makeSet();
			comp = n;

		}

		void makeSet() {

			for (int i = 0; i < n; i++) {
				parent[i] = i;
				rank[i] = 1;
			}
		}

		void makeparent(int a) {

			int p = findSet(a);

			if (parent[a] != a) {
				int temp = parent[p];
				parent[a] = a;
				parent[temp] = a;
			}
		}

		int findSet(int x) {
			if (parent[x] != x) {

				parent[x] = findSet(parent[x]);
				rank[x] = rank[parent[x]];
			}

			return parent[x];
		}

		int union(int x, int y) {
			int xRoot = findSet(x);
			int yRoot = findSet(y);
			if (xRoot == yRoot) {
				return rank[xRoot];
			}

			comp--;

			if (rank[xRoot] < rank[yRoot]) {
				parent[xRoot] = yRoot;
				rank[yRoot] += rank[xRoot];

				return rank[yRoot];
			}

			else if (rank[yRoot] < rank[xRoot]) {
				parent[yRoot] = xRoot;
				rank[xRoot] += rank[yRoot];
				return rank[xRoot];
			}

			else {
				parent[yRoot] = xRoot;
				rank[xRoot] = rank[xRoot] * 2;
				return rank[xRoot];
			}
		}

	}

	static class Node implements Comparable<Node> {
		long x;
		long y;
		long r;

		public Node(long i, long j, long rr) {
			x = i;
			y = j;
			r = rr;
		}

		public int compareTo(Node p) {
			return Long.compare(this.r, p.r);
		}

	}

	static class InputReader {

		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar;
		private int snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}

			int res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}

			long res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));

			return res * sgn;
		}

		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}