Олимпиадный тренинг

Задача 27078. The amount of the fine


In order to replenish the budget and save fuel, the new mayor of the town of Glupov decided to conduct a campaign to combat left-handed slopes and left-handed flights. To do this, he banned drivers from making left turns, setting a fine for each left turn in the amount of one million (a U-turn is not considered a left turn).
 
From a difficult past, Glupov inherited streets that can intersect at any angle. The mayor ordered the installation of a computer system of total surveillance that monitors each car, recording its coordinates every time it changes direction (including the start and end points of the path).
 
It is required to write a program that calculates, from the recorded sequence of car coordinates, a fine to be collected from the driver.
 
Input
The first line contains an integer N - the number of pairs of coordinates written (\(1 <= N <= 1000\) ). Each of the following N lines contains the next of these pairs (real numbers).
 
Output
Display the driver's total fine in millions.

 

Examples
# Input Output
1
4
0 0
10
1 1
2 1
1