#d11401. 放置多米诺骨牌
放置多米诺骨牌
Placing Dominoes
Problem Description
You are given a histogram-like figure with columns whose heights are (). You have many dominoes (which may be rotated). What is the maximum number of dominoes you can place without overlap?
Input Format
The first line contains an integer .
The next line contains integers .
Output Format
Output one number: the answer.
Sample Input
5
3 2 2 2 1
Sample Output
4
Constraints
All data guarantee , .