import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class race_as implements Runnable {
    int n;
    int[] x;
    int[] y;
    int w;

    boolean cangol(int xp, int yp, int k) {
        for (int i = 0; i < k; i++) {
            if (yp < y[i] || y[i] + w < yp) {
                return false;
            }
        }
        return true;
    }

    boolean valid(int xf, int yf, int xt, int yt, int l, int r) {
        for (int i = l; i < r; i++) {
            if ((x[i] - xf) * (yt - yf) < (y[i] - yf) * (xt - xf)) {
                return false;
            }
            if ((x[i] - xf) * (yt - yf) > (y[i] + w - yf) * (xt - xf)) {
                return false;
            }
        }
        return true;
    }

    boolean cangor(int xp, int yp, int k) {
        for (int i = k + 1; i < n; i++) {
            if (yp < y[i] || y[i] + w < yp) {
                return false;
            }
        }
        return true;
    }

    public void solve() throws IOException {
        Scanner in = new Scanner(new File("race.in"));
        PrintWriter out = new PrintWriter(new File("race.out"));

        n = in.nextInt() + 1;
        x = new int[n];
        y = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
            assert abs(x[i]) <= 10000 && abs(y[i]) <= 10000;
            if (i > 0) {
            	assert x[i] > x[i - 1];
            }
        }
        assert x[0] == 0;
        w = in.nextInt();

        double[][] d = new double[2][n];
        Arrays.fill(d[0], Double.MAX_VALUE);
        Arrays.fill(d[1], Double.MAX_VALUE);
        d[0][0] = 0;
        d[1][0] = 0;
        for (int i = 1; i < n; i++) {
            if (cangol(x[i], y[i], i)) {
                d[0][i] = x[i];
            }
            if (cangol(x[i], y[i] + w, i)) {
                d[1][i] = x[i];
            }

            for (int j = 0; j < i; j++) {
                if (valid(x[j], y[j], x[i], y[i], j, i)) {
                    d[0][i] = min(d[0][i], d[0][j] + hypot(x[i] - x[j], y[i] - y[j]));
                }
                if (valid(x[j], y[j], x[i], y[i] + w, j, i)) {
                    d[1][i] = min(d[1][i], d[0][j] + hypot(x[i] - x[j], y[i] + w - y[j]));
                }
                if (valid(x[j], y[j] + w, x[i], y[i], j, i)) {
                    d[0][i] = min(d[0][i], d[1][j] + hypot(x[i] - x[j], y[i] - y[j] - w));
                }
                if (valid(x[j], y[j] + w, x[i], y[i] + w, j, i)) {
                    d[1][i] = min(d[1][i], d[1][j] + hypot(x[i] - x[j], y[i] + w - y[j] - w));
                }
            }
        }

        double answer = Double.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            if (cangor(x[i], y[i], i)) {
                answer = min(answer, d[0][i] + x[n - 1] - x[i]);
            }
            if (cangor(x[i], y[i] + w, i)) {
                answer = min(answer, d[1][i] + x[n - 1] - x[i]);
            }
        }

        out.printf("%.10f\n", answer);

        in.close();
        out.close();
    }

    public void run() {
        try {
            solve();
        } catch (IOException e) {
            System.exit(64);
        }
    }

    public static void main(String[] arg) throws IOException {
        Locale.setDefault(Locale.US);
        new Thread(new race_as()).start();
    }
}
