Academic Distance

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Starting from the second semester, Mr. Eto will take classes at Kyoto University. Mr. Eto is not accustomed to the structure of the university because in the first semester he had only online lectures.

There are NN classes today. The schedule contains the coordinates of NN classrooms in the order in which they have to be visited. The coordinates of the ii-th classroom are (x_i,y_i)(x\_i, y\_i). Assuming Mr. Eto starts the day in the first classroom, and ends in the NN-th classroom, calculate the total distance he has to travel.

In Kyoto University campus, the distance traveled from the coordinates (a,b)(a, b) to the coordinates (c,d)(c, d) is equal to ac+bd|a-c| + |b-d|.

입력

The first line of the input contains one integer NN (1N1001 \le N \le 100), the number of classrooms in today's schedule. Then NN lines follow, ii-th of them containing integer coordinates x_ix\_i and y_iy\_i of the ii-th classroom in the schedule (100x_i,y_i100-100 \le x\_i, y\_i \le 100).

출력

Print one integer: the total distance traveled by Mr. Eto by the end of the day.