Skateboard#4745

Skateboard

1 second
64 megabytes
Very easy

Beginner skateboarder Den wants to ride his skateboard. Unfortunately, the road he has chosen is far from even, and due to lack of experience, Den cannot overcome hills — at the peak of each one, he inevitably falls and scrapes his knees. Knowing this, his friend Kat sighs, brings an antiseptic with her, and tries to convince Den to put an end to these adventures for her sake, since it's not hard to guess why he planned this walk ;) But stubborn Den refuses to give up and decides to ride the whole road.

Kat wonders how many times during this ill-fated outing she'll have to give Den first aid.

Input

The first line contains the number — the number of road kinks (3 \leq N \leq 1000).

The next line contains numbers a_i (-1000 \leq a_i \leq 1000), which are the -coordinates of the kinks from left to right. The road between two neighboring kinks is a segment connecting them. No two neighboring numbers are equal (a_1 < a_2, a_{N-1} > a_N).

Output

Output one number — the number of times Den falls.

Examples

Example 1

Loading
Loading