n=input() l=map(int,raw_input().split(" ")) mv=0 for i in l: if i%2==0: mv+=2*(i-1) else: if i<>1: mv+=(i+1) else: mv+=1 print mv