#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include <vector>
#include <map>
#include <string>
#include<unordered_map>
#include <unordered_set>
#include<set>
#include<queue>
#include<iomanip>
#include <bitset>
#include <algorithm>
#include "math.h"

typedef long long ll;
using namespace std;

#define double long double

vector<pair<ll, ll>> pt;
int endx, endy;
double alpha = 1e9;

double dist(pair<double, double> a)
{
    return a.first * a.first + a.second * a.second;
}

double get_angle(pair<double, double> a)
{
    pair<double, double> vec1 = { a.first - endx, a.second - endy };
    pair<double, double> vec2 = { 0, -endy };
    double pp = vec1.first * vec2.first + vec1.second * vec2.second;
    double ang = pp * 1.0 / sqrt(dist(vec1)) / sqrt(dist(vec2));
    return ang;
}

void solve()
{
    int n, H;
    cin >> n >> H;
    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        pt.push_back({ x, y });
    }
    endx = pt.back().first;
    endy = pt.back().second + H;
    double ans = 0;
    for (int i = n - 1; i >= 1; i--)
    {
        int show1 = 0, show2 = 0;
        double angle1 = get_angle(pt[i]);
        if (angle1 < alpha + 1e-9)
        {
            alpha = angle1;
            show1 = 1;
        }
        double save = alpha;
        double angle2 = get_angle(pt[i - 1]);
        if (angle2 < alpha + 1e-9)
        {
            alpha = angle2;
            show2 = 1;
        }
        if (show1 && show2)
        {
            ans += sqrt(dist({ pt[i].first - pt[i - 1].first, pt[i].second - pt[i - 1].second }));
        }
        else if (!show1 && !show2)
            continue;
        else if (show1 && !show2)
        {
            continue;
        }
        else if (!show1 && show2)
        {
            double start = 0;
            double end = 1;
            for (int j = 0; j < 200; j++)
            {
                double mid = (start + end) / 2;
                double angle = get_angle({ pt[i - 1].first + (pt[i].first - pt[i - 1].first) * mid,
                                           pt[i - 1].second + (pt[i].second - pt[i - 1].second) * mid });
                if (angle < save)
                {
                    start = mid;
                }
                else
                    end = mid;
            }
            pair<double, double> ppp = { pt[i - 1].first + (pt[i].first - pt[i - 1].first) * start,
                                         pt[i - 1].second + (pt[i].second - pt[i - 1].second) * start };
            ans += sqrt(dist({ pt[i - 1].first - ppp.first, pt[i - 1].second - ppp.second }));
        }
    }
    cout << ans;
}

int main()
{
    cout << fixed << setprecision(20);
    solve();

}
