#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
const int N = 2e5 + 10;
int n, h;
struct point
{
	double x, y;
}p[N], peo, high;
double dis(point i, point j)
{
	return sqrt((i.x - j.x) * (i.x - j.x) + (i.y - j.y) * (i.y - j.y));
}
bool check(point a1, point a2, point b)
{
	return (a1.y - b.y) * (a2.x - b.x) <= (a2.y - b.y) * (a1.x - b.x);
}
point jiao(point a1, point a2, point b1, point b2)
{
	double k1 = (a1.y - a2.y) / (a1.x - a2.x);
	double l1 = a1.y - a1.x * k1;
	double k2 = (b1.y - b2.y) / (b1.x - b2.x);
	double l2 = b1.y - b1.x * k2;
	double x = (l2 - l1) / (k1 - k2);
	x = max(min(a2.x, x), a1.x);
	return (point){x, k1 * x + l1};
}
int main()
{
	scanf("%d%d", &n, &h);
	for (int i = 1; i <= n; ++ i)
	{
		scanf("%lf%lf", &p[i].x, &p[i].y);
	}
	peo = (point){p[n].x, p[n].y + h};
	high = p[n];
	double ans = 0;
	for (int i = n - 1; i; -- i)
	{
		if(check(p[i], high, peo))
		{
			point pw = jiao(p[i], p[i + 1], high, peo);
			ans += dis(pw, p[i]);
			high = p[i];
		}
	}
	printf("%.9lf", ans);
}