#!/bin/python3 import sys def longestSequence(a): # Return the length of the longest possible sequence of moves. tota=1 for choco in a: if(choco%2!=0): tota+=choco else: tota+=choco+(choco//2) return tota if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)