#!/usr/bin/env python3 #WA: iterates up to a fixed depth (2000000 just about solves all small-steps cases) depth = 2000000 n = int(input()) pts = [] for i in range(n): pts.append([float(i) for i in input().split()]) #Determine area I under polyline, i.e. depth 0 I = 0 for i in range(1,n): #compute integral per trapezoid I += 0.5 * (pts[i][1] + pts[i-1][1]) * (pts[i][0] - pts[i-1][0]) #Do efficient by keeping a running square length, likely no contestant #will do this without solving the entire recursion but this should #exclude even the fasters recursions. len2 = 0 for i in range(1,n): li2 = (pts[i][0] - pts[i-1][0]) ** 2 + (pts[i][1] - pts[i-1][1]) ** 2 len2 += li2 currlen2 = 1. area = 0. for i in range(depth): area += currlen2 * I currlen2 *= len2 #Add area three times to area initial triangle (i.e. sqrt(3)/4) print((3 ** 0.5 / 4) + 3 * area)