import java.util.*;
import java.io.*;

class circles_as {
    FastScanner in;
    PrintWriter out;

    final static long MAX = 100000000;

    class Circle {
        long x;
        long y;
        long r;

        Circle(long x, long y, long r) {
            this.x = x;
            this.y = y;
            this.r = r;
        }
    }

    class Event implements Comparable<Event> {
        long x;
        long y;
        long r;
        int s;

        Event(long x, long y, long r, int s) {
            this.x = x;
            this.y = y;
            this.r = r;
            this.s = s;
        }

        public int compareTo(Event o) {
            if (x + s * r != o.x + o.s * o.r) {
                long d = x + s * r - (o.x + o.s * o.r);
                return d < 0 ? -1 : d > 0 ? 1 : 0;
            }
            if (y != o.y) {
                return (int) (y - o.y);
            }
            if (o.s != s) {
                return o.s - s;
            }
            return (int) (o.r - r);
        }

        @Override
        public String toString() {
            return "<" + x + " " + y + " " + r + " " + s + ">";
        }
    }

    long curx;

    final static double EPS = 1e-6;

    class CirclePoint implements Comparable<CirclePoint> {
        long cx;
        long cy;
        long r;
        int s;

        CirclePoint(long cx, long cy, long r, int s) {
            this.cx = cx;
            this.cy = cy;
            this.r = r;
            this.s = s;
        }

        double get(long x) {
            if (x < cx - r || x > cx + r) {
                System.out.println("Cannot get at " + x + " for " + "(" + cx + " " + cy + " " + r + " " + s + ")");
                throw new AssertionError();
            }
            return cy + s * Math.sqrt(r * r - (cx - x) * (cx - x));
        }

        public int compareTo(CirclePoint o) {
            double v = get(curx);
            double ov = o.get(curx);
            if (v < ov - EPS) {
                return -1;
            }
            if (v > ov + EPS) {
                return 1;
            }
            if (s != o.s) {
                return s - o.s;
            }
            return (int) (o.r - r);
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            CirclePoint that = (CirclePoint) o;

            if (cx != that.cx) return false;
            if (cy != that.cy) return false;
            if (r != that.r) return false;
            if (s != that.s) return false;

            return true;
        }

        @Override
        public String toString() {
            return "(" + cx + " " + cy + " " + r + " " + s + " @" + get(curx) + ")"; 
        }
    }

    public void solve() throws IOException {
        int n = in.nextInt();
        Circle[] c = new Circle[n];
        Event[] events = new Event[2 * n];

        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            int r = in.nextInt();
            c[i] = new Circle(x, y, r);
            events[2 * i] = new Event(x, y, r, -1);
            events[2 * i + 1] = new Event(x, y, r, 1);
        }

        Arrays.sort(events);

        TreeSet<CirclePoint> ts = new TreeSet<CirclePoint>();
        ts.add(new CirclePoint(0, -2 * MAX, MAX, 1));
        long ans = 0;
        for (Event e : events) {
            curx = e.x + e.r * e.s;
//            System.out.println(ts);
            if (e.s == -1) {
                CirclePoint cpu = new CirclePoint(e.x, e.y, e.r, -1);
                SortedSet<CirclePoint> head = ts.headSet(cpu);
                if (head.last().s == 1) {
                    ans += 1L * e.r * e.r;
                    ts.add(cpu);
                    CirclePoint cpl = new CirclePoint(e.x, e.y, e.r, 1);
                    ts.add(cpl);
                }
            } else {
                ts.remove(new CirclePoint(e.x, e.y, e.r, -1));
                ts.remove(new CirclePoint(e.x, e.y, e.r, 1));
            }
        }

        System.out.println(ans);
        out.println(Math.PI * ans);
    }

    public void run() {
        try {
            in = new FastScanner(new File("circles.in"));
            out = new PrintWriter(new File("circles.out"));

            solve();

            in.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] arg) {
        new circles_as().run();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(File in) {
            try {
                br = new BufferedReader(new FileReader(in));
            } catch (FileNotFoundException e) {
                throw new AssertionError(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new AssertionError(e);
                }
            }
            return st.nextToken();
        }

        void close() {
            try {
                br.close();
            } catch (IOException e) {
                throw new AssertionError(e);
            }
        }
    }

}