import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] base = new int[n + 1]; int[] sums = new int[n + 1]; for (int i = 1; i <= n; i++) { base[i] = sc.nextInt(); sums[i] = sums[i - 1] + base[i] / 2; } int max = 0; for (int i = 1; i <= n; i++) { max = Math.max(max, base[i] + sums[i - 1] + sums[n] - sums[i]); } System.out.println(max); } }