Robot#6458

Robot

2 seconds
128 megabytes
Medium

You are participating in a robot programming contest. In the next competition, your robot has to pass through points on a plane in a fixed order. However, your robot's path must satisfy the following requirements:

In order to win, you have to find a path for your robot which has the minimum possible length.

Input

The first line contains a single integer (2 \le n \le 1000), the number of points. Each of the next lines contains two integers x_i and y_i not exceeding 10^6 by absolute value: the coordinates of the -th point. The robot must visit these points in the order they are given in the input. Every two adjacent points are distinct. However, it is not guaranteed that all points in the input will be distinct.

Output

Print one real number: the length of the shortest path. Your answer will be accepted if the absolute or relative error is no more than 10^{-6}.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading