#include<bits/stdc++.h>
#define endl '\n'
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define lg2(x) __lg(x)
#define rem_dupl(x) sort(all(x)); x.erase(unique(all(x)), x.end())
using namespace std;

typedef long long ll;
typedef long double db;
typedef pair<db,db> point;
#define x first
#define y second

point operator -(point a, point b){
    return {a.x - b.x, a.y - b.y};
}
db cross(point a, point b){
    return a.x * b.y - a.y * b.x;
}
db area2(point a, point b, point c){
    return cross(b - a, c - a);
}

const db eps = 1e-9;
const int maxn = (int)2e5 + 5;

point P[maxn], eye;
int n;
ll H;

db dist(point a, point b){
    return hypot(a.x - b.x, a.y - b.y);
}

struct line{
    db m,  c; /// y = m*x + c
    line(){}
    line(db _m, db _c): m(_m), c(_c){}
};

point intersect(line a, line b){
    db x = (b.c - a.c)/(a.m - b.m);
    db y = a.m * x + a.c;
    return {x, y};
}

line getline(point a, point b){
    line l;
    db m = (a.y - b.y)/(a.x - b.x);
    db c = a.y - m * a.x;
    l = line(m, c);
    return l;
}


int main() {
    cout.setf(ios::fixed); cout.precision(8);

 scanf("%d%d", &n, &H);
    for(int i = 1; i <= n; i++)
	{
		double a, b;
		scanf("%lf%lf", &a, &b);
		P[i].x = a;
		P[i].y = b;
	}
    db ans = 0;
    eye = P[n]; eye.y += H;

    ans += dist(P[n-1], P[n]);

    int p = n-1;
    line cur = getline(eye, P[n-1]);

    for(int i = n-1; i > 1; i--){
        line l = getline(P[i], P[i-1]);
        //cout << i << ' ' << ans << ' ' << p << endl;
        if(area2(eye, P[p], P[i-1]) > 0 and area2(eye, P[p], P[i]) >= 0)
            continue;

        if(area2(eye, P[p], P[i-1]) == 0 and area2(eye, P[p], P[i]) == 0){
            ans += dist(P[i-1], P[i]);
            continue;
        }
        if (area2(eye, P[p], P[i-1]) * area2(eye, P[p], P[i]) > 0)
            continue;
        //cout << i << endl;
        point I = intersect(cur, l);
        //cout << I.x << ' ' << I.y << ' ' << max(P[i - 1].x, P[i].x) << ' ' << (int(I.x) > int(max(P[i - 1].x, P[i].x))) << endl;
        if(I.x - min(P[i-1].x, P[i].x)<-eps or I.x - max(P[i-1].x, P[i].x)>eps)
            continue;

        ans += dist(I, P[i-1]);
        cur = getline(eye, P[i-1]);
        p = i-1;
        //cout << i << ' ' << ans << endl;
    }

    cout << ans;


    return 0;
}
