#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
 
using namespace std;
 
double eps=1e-17;
 
struct Node
{
	double x,y;
}nd[400010];
 
int n,H;
 
double ang(int x)
{
	Node a=nd[x],b=nd[n+1];
	return (b.y-a.y)/(b.x-a.x);
}
 
Node getcross(Node a,Node b,Node c,double k)
{
	double k1=(b.y-a.y)/(b.x-a.x);
	double b1=b.y-k1*b.x;
	double k2=k;
	double b2=c.y-k2*c.x;
	Node ret;
	ret.x=(b2-b1)/(k1-k2);
	ret.y=k1*ret.x+b1;
	return ret;
}
 
int main()
{
    ios::sync_with_stdio(false);
	
	scanf("%d%d",&n,&H);
	for(int i=1;i<=n;i++) scanf("%lf%lf",&nd[i].x,&nd[i].y);
	nd[n+1].x=nd[n].x;nd[n+1].y=nd[n].y+H;
	
	double angle=ang(n-1),ans=sqrt((nd[n-1].x-nd[n].x)*(nd[n-1].x-nd[n].x)+(nd[n-1].y-nd[n].y)*(nd[n-1].y-nd[n].y));
	for(int i=n-1;i>=2;i--)
	{
		Node a=nd[i],b=nd[i-1];
		
		if(ang(i)>angle && ang(i-1)>angle)
		{
			continue;
		}
		if(fabs(ang(i)-angle)<eps && fabs(ang(i-1)-angle)<eps)
		{
			ans+=sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
			angle=min(ang(i),ang(i-1));
			continue;
		}
		if(ang(i)>=angle && ang(i-1)<angle)
		{
			Node C=getcross(a,b,nd[n+1],angle);
			ans+=sqrt((C.x-b.x)*(C.x-b.x)+(C.y-b.y)*(C.y-b.y));
			angle=min(angle,ang(i-1));
		}
	}
	cout<<fixed<<setprecision(17)<<ans<<endl;
	
    return 0;
}