// Arup Guha
// 6/7/2018
// Solution to 2013 KTH Problem G: Forest Highway

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

public class forest {

	public static int n;
	public static pt[] poly;
	public static line[] segs;
	public static double dist;
	public static line myl;
	public static line[] borders;
	public static double area;

	public static void main(String[] args) throws Exception {

		// Read in the points.
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(stdin.readLine().trim());
		poly = new pt[n];
		for (int i=0; i<n; i++) {
			StringTokenizer tok = new StringTokenizer(stdin.readLine());
			double x = Double.parseDouble(tok.nextToken());
			double y = Double.parseDouble(tok.nextToken());
			poly[i] = new pt(x, y);
		}

		// Form line segments and calculate area.
		segs = new line[n];
		area = 0;
		for (int i=0; i<n; i++) {
			segs[i] = new line(poly[i], poly[(i+1)%n]);
			area += (poly[i].x*poly[(i+1)%n].y - poly[i].y*poly[(i+1)%n].x);
		}
		area = Math.abs(area)/2.0;

		// Get my line.
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		double x1 = Double.parseDouble(tok.nextToken());
		double y1 = Double.parseDouble(tok.nextToken());
		double x2 = Double.parseDouble(tok.nextToken());
		double y2 = Double.parseDouble(tok.nextToken());
		myl = new line(new pt(x1, y1), new pt(x2, y2));
		dist = Double.parseDouble(stdin.readLine().trim());

		// Calculate both parallel lines with distance d from myl.
		borders = myl.getParallel(dist);

		// Now get all of our intersections and sort in order.
		ArrayList<Double> critical = new ArrayList<Double>();
		for (int i=0; i<2; i++) {
			for (int j=0; j<n; j++) {
				Double tmp = segs[j].intersect(borders[i]);
				if (tmp != null) critical.add(j+tmp);
			}
		}

		// Now, we add each point of the polygon within the strip.
		for (int i=0; i<n; i++)
			if (myl.dist(poly[i]) < dist + 1e-9)
				critical.add((double)i);

		// Sort and solve!
		Collections.sort(critical);
		System.out.println(solve(critical));
	}

	public static double solve(ArrayList<Double> critical) {

		// Tricky case!
		if (critical.size() == 0) return area;

		// Now, just copy unique values into this list.
		ArrayList<Double> trim = new ArrayList<Double>();
		trim.add(critical.get(0));
		for (int i=1; i<critical.size(); i++)
			if (critical.get(i) - 1e-9 > trim.get(trim.size()-1))
				trim.add(critical.get(i));

		// Calculate this signed area.
		double subarea = 0;
		int len = trim.size();
		for (int i=0; i<len; i++) {

			// Extract relevant intersection info.
			int i1 = (int)(trim.get(i)+1e-9);
			double lambda1 = trim.get(i) - i1;
			pt a = segs[i1].getPt(lambda1);
			int i2 = (int)(trim.get((i+1)%len)+1e-9);
			double lambda2 = trim.get((i+1)%len) - i2;
			pt b = segs[i2].getPt(lambda2);
			subarea += (a.x*b.y - a.y*b.x);
		}

		subarea = Math.abs(subarea/2);

		// Ta da!
		return area - subarea;
	}
}

class pt {

	public double x;
	public double y;
	public double mag;
	public String toString() {
		return "("+x+", "+y+") ";
	}

	public pt(double myx, double myy) {
		x = myx;
		y = myy;
		mag = Math.sqrt(x*x+y*y);
	}

	public pt subtract(pt other) {
		return new pt(x-other.x, y-other.y);
	}

	public pt add(pt other) {
		return new pt(x+other.x, y+other.y);
	}

	public pt multiply(double factor) {
		return new pt(x*factor, y*factor);
	}

	public pt negate() {
		return new pt(-x,-y);
	}

	public pt getUnitPerp() {
		return new pt(y/mag,-x/mag);//.multiply(1.0/mag());
	}
}

class line {

	public pt s;
	public pt e;
	public pt dir;

	public line(pt start, pt end) {
		s = start;
		e = end;
		dir = e.subtract(s);
	}

	// Returns two lines parallel to this one that are distance d from it.
	public line[] getParallel(double d) {

		// Get both perpendicular vectors to this line.
		pt perp = dir.getUnitPerp().multiply(d);
		pt otherperp = perp.negate();

		// Form two pts on first line.
		pt s1 = s.add(perp);
		pt e1 = s1.add(dir);

		// And second line.
		pt s2 = s.add(otherperp);
		pt e2 = s2.add(dir);

		// Create lines and return.
		line[] res = new line[2];
		res[0] = new line(s1, e1);
		res[1] = new line(s2, e2);
		return res;
	}

	// Returns the pt on this line at parameter lambda.
	public pt getPt(double lambda) {
		return new pt(s.x+lambda*dir.x, s.y+lambda*dir.y);
	}

	// Returns the distance of pt to this line.
	public double dist(pt other) {
		pt dirToLine = s.subtract(other);
		double crossMag = Math.abs(dirToLine.x*dir.y-dirToLine.y*dir.x);
		return crossMag/dir.mag;
	}

	// Returns the lambda of the intersection btw this segment and the line other.
	public Double intersect(line other) {

		double den = det(dir.x, -other.dir.x, dir.y, -other.dir.y);
		if (Math.abs(den) < 1e-9) return null;

		// I only return if it's on the segment itself.
		double num = det(other.s.x-s.x, -other.dir.x, other.s.y-s.y, -other.dir.y);
		return num/den >= -1e-9 && num/den <= 1 + 1e-9 ? num/den : null;
	}

	// Returns the 2 x 2 determinant with a b on top row, c d on bottom row.
	public static double det(double a, double b, double c, double d) {
		return a*d - b*c;
	}
}
