#include <iostream>
#include <fstream> 
#include <math.h> 

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#define ll long long
#define last p[i + 1] 
#define curr p[i]
// #define Point pair<double, double> 
using namespace std; 
 
struct Point
{ 
	long long x, y;
	Point(){}
	Point(long long x, long long y): x(x), y(y){} 
	Point operator + (Point &P){ return Point(x + P.x, y + P.y);}
	Point operator - (Point &P){ return Point(x - P.x, y - P.y);}
};
 
long long dot(Point &a, Point &b)
{ 
	return a.x * b.x + a.y * b.y;
}
 
void solve(Point *p, ll &n, ll &h)
{ 
	// 2 <= n <- 2e5; 
	double result = 0;
	Point eye(p[n].x, p[n].y + h); 
	Point peak(p[n].x, p[n].y); 
	Point vep, vrep, vec, vel; 
	Point T, R; 

	for(int i = n - 1; i >= 1; --i)
	{ 
		vep 	= peak - eye; 
		vrep 	= Point(vep.y, - vep.x);  
		vec		= curr - eye; 
		vel 	= last - eye; 
		
		long long h1 = dot(vec, vrep); 
		long long h2 = dot(vel, vrep); 

		if (h2 >= 0)
			if (h1 >= 0) 
				T = vec - vel,
				result = result + sqrt(dot(T, T)),
				peak = curr; 
		if (h2 < 0)
			if (h1 >= 0) 
				T = vec - vel, 
				result = result + (sqrt(dot(T, T)) * ((h1 * 1.0)/(1.0*(h1 - h2)))), 
				peak = curr;
	}
	printf("%.12lf\n",result);
}

int main()
{ 
 
	ios_base::sync_with_stdio(false); 
	cin.tie(NULL); 
	cout.tie(NULL); 

	long long n; 
	long long h; 	
	Point p[200005]; 


	cin >> n >> h;
	for(int i = 1; i <= n; ++i) 
		cin >> p[i].x >> p[i].y; 
	
	solve(p, n, h); 
	return 0; 
}
