This page is still under construction.

Parts of this page are still being built. What you see may change.

Minigolf

Time limit1sMemory limit1024 MB

Summary
Given strokes per hole, with odd holes par 2 and even holes par 3 and any hole capped at 7 strokes, print the total score relative to par.
Level

Easy2 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

A minigolf course has NN holes. Every odd-numbered hole is a "par 2" and every even-numbered hole is a "par 3", where "par" is the recommended number of strokes a golfer should need to complete that hole. There is also a rule that if you take more than 77 strokes on a hole, it still counts as only 77 strokes in the final tally.

Write a program that, given the number of strokes you took on each hole, calculates the total score over or under par.

Input

The first line contains a single integer NN, the number of holes, where 2≤N≤102\le N\le 10. The second line contains NN integers between 1 and 10: the number of strokes you took on each hole.

Output

Print a single integer, the total score over or under par.

Examples2

  1. Example 1

    Input
    3
    5 3 1
    
    Expected output
    2
    
  2. Example 2

    Input
    6
    1 9 1 1 1 1
    
    Expected output
    -3