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

public class greatwall_mb_convex {
    private static class Point {
        public final int x, y;
        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }
        public Point subtract(Point arg) {
            return new Point(x - arg.x, y - arg.y);
        }
        public Point add(Point arg) {
            return new Point(x + arg.x, y + arg.y);
        }
        public String toString() {
            return "(" + x + "; " + y + ")";
        }
        public int smul(Point arg) {
            return x * arg.x + y * arg.y;
        }
        public int vmul(Point arg) {
            return x * arg.y - y * arg.x;
        }
        public Point multiply(int t) {
            return new Point(x * t, y * t);
        }
        public double distTo(Point p) {
            p = p.subtract(this);
            return Math.sqrt(p.smul(p));
        }
    }

    private static boolean leftTurn(Point base, Point left, Point right) {
        return (left.x - base.x) * (right.y - base.y) > (left.y - base.y) * (right.x - base.x);
    }

    private static Point[] hull(Point[] poly) {
        for (int i = 0; i < poly.length; ++i) {
            if (poly[i].x < poly[0].x || poly[i].x == poly[0].x && poly[i].y < poly[0].y) {
                Point tmp = poly[i];
                poly[i] = poly[0];
                poly[0] = tmp;
            }
        }
        final Point base = poly[0];
        for (int i = 0; i < poly.length; ++i) {
            poly[i] = poly[i].subtract(base);
        }
        Arrays.sort(poly, 1, poly.length, new Comparator<Point>() {
            public int compare(Point lhs, Point rhs) {
                int vmul = lhs.vmul(rhs);
                if (vmul == 0) {
                    int smul1 = lhs.smul(lhs);
                    int smul2 = rhs.smul(rhs);
                    return smul1 < smul2 ? -1 : smul1 == smul2 ? 0 : 1;
                } else {
                    return -vmul;
                }
            }
        });
        List<Point> stack = new ArrayList<Point>();
        stack.add(poly[0]);
        stack.add(poly[1]);
        for (int i = 2; i < poly.length; ++i) {
            int sz;
            while ((sz = stack.size()) > 1 && !leftTurn(stack.get(sz - 2), stack.get(sz - 1), poly[i])) {
                stack.remove(sz - 1);
            }
            stack.add(poly[i]);
        }
        for (int i = 0; i < stack.size(); ++i) {
            stack.set(i, base.add(stack.get(i)));
        }
        return stack.toArray(new Point[stack.size()]);
    }

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(new File("greatwall.in"));
        int n = in.nextInt() * 3;
        Point[] pts = new Point[n];
        for (int i = 0; i < n; ++i) {
            pts[i] = new Point(in.nextInt(), in.nextInt());
        }
        in.close();
        pts = hull(pts);
        n = pts.length;
        double ans = pts[n - 1].distTo(pts[0]);
        for (int i = 1; i < n; ++i) {
            ans += pts[i - 1].distTo(pts[i]);
        }
        PrintWriter out = new PrintWriter("greatwall.out");
        out.println(ans);
        out.close();
    }
}
