#include<bits/stdc++.h>
#define point pair<double,double>
#define pdd pair<double,double>
#define x first
#define y second
using namespace std;
 
struct segment
{
    point st,ed;
 
    segment(point a, point b)
    {
        st = a, ed = b;
    }
 
    point ration(double r)
    {
        double x = ed.x + (st.x - ed.x) * r;
        double y = ed.y + (st.y - ed.y) * r;
        return {x,y};
    }
};
 
double dist(point a, point b)
{
    return sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y));
}
 
double angle(point pt, point center)
{
    double co = (center.y - pt.y)/dist(pt,center);
    return acos(co);
}
 
int main()
{
    int n,H,i;
    cin>>n>>H;
    vector<segment> v;
    point last;
    int a,b;
    cin>>a>>b;
    last = {a,b};
    for(i=0;i<n-1;i++)
    {
        cin>>a>>b;
        point cur = {a,b};
        v.push_back(segment(last,cur));
        last = cur;
    }
    point center = {last.x,last.y+H};
    pdd cover = {0,0};
    double dis = 0;
    while(!v.empty())
    {
        segment cur = v.back();
        v.pop_back();
        double stangle = angle(cur.st,center);
        double edangle = angle(cur.ed,center);
        if(stangle < cover.y)
            continue;
        else
        {
            double mini = 0, maxi = 1;
            while(mini < maxi - 1e-10)
            {
                double mid = (mini+maxi)/2;
                point cu = cur.ration(mid);
                if(angle(cu,center) < cover.y)
                    mini = mid;
                else
                    maxi = mid;
            }
            cover.y = stangle;
            dis += dist(cur.ration(mini),cur.st);
        }
    }
    printf("%.20f",dis);
    return 0;
}