Frog#9628

Frog

1 second
128 megabytes
Medium

There are stones, numbered from to . The -th stone has height h_i (1 \le i \le n). A frog sits initially on stone .

The frog wants to reach stone , and it can jump from stone to stone i+1 or i+2. The cost of a jump from stone to stone is |h_i - h_j|.

Find the minimum total cost required for the frog to reach stone .

Input

The first line contains the number of stones (2 \le n \le 10^5). The second line contains integers h_1, h_2, \dots, h_n (1 \le h_i \le 10^4).

Output

Print the minimum total cost for the frog to reach stone .

Examples

Example 1

Loading
Loading