#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
pair <double,double> a[200005];
inline pair<double,double> getl(pair<double,double> A,pair<double,double> B)
{
	double k=(A.second-B.second)/(A.first-B.first);
	return {k,A.second-A.first*k};
}
inline double dis(pair<double,double> A,pair<double,double> B)
{
	return sqrt((A.first-B.first)*(A.first-B.first)+(A.second-B.second)*(A.second-B.second));
}
inline double getp(pair<double,double> A,pair<double,double> B)
{
	return (B.second-A.second)/(A.first-B.first);
}
inline double f(pair<double,double> x,double y)
{
	return y*x.first+x.second;
}
int main(int argc, char** argv) {
	int n,h;
	cin >> n >> h;
	for(int i=1;i<=n;i++) scanf("%lf%lf",&a[i].first,&a[i].second);
	pair<double,double> qaq={a[n].first,a[n].second+h},x=getl({0,-1e30},qaq);
	double ans=0;
	int pos=0;
	for(int i=n-1;i>=1;i--)
	{
		pair<double,double> qwq=getl(a[i],a[i+1]),nxt=getl(qaq,a[i]);
		if(fabs(x.first-qwq.first)<=1e-9&&fabs(x.second-qwq.second)<=1e-9||i==n-1)
		{
			ans+=dis(a[i],a[i+1]);
			if(nxt<x) x=nxt,pos=i;
			continue;
		}
		if(fabs(qwq.first-x.first)<=1e-9)
		{
			if(qwq.second>=x.second-1e-13) ans+=dis(a[i],a[i+1]);
			if(nxt<x) x=nxt,pos=i;
			continue;
		}
		double X=getp(x,qwq);
		if(min(getl(qaq,a[i+1]).first,getl(qaq,a[i]).first)<x.first)
			ans+=dis(a[i],a[i+1])*(X-a[i].first)/(a[i+1].first-a[i].first);
		else if(f(x,a[i].first)+1e-9>=a[i].second&&f(x,a[i+1].first)+1e-9>=a[i+1].second);
		else ans+=dis(a[i],a[i+1]);
		if(nxt<x) x=nxt,pos=i;
	}
	printf("%.10lf",ans);
	return 0;
}
  			  	 		 	 	 	   	 	 		  		