import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;

const L = int.max / 2;

void dump(int[][][] x) {
    foreach (i; 0 .. 2) {
        foreach (j; 0 .. x[0].length) {
            x[i][j].map!((a) => (a == L ? -1 : a)).writeln;
        }
        writeln;
    }
    writeln;
}

void main() {
    int N;
    readf("%d\n", &N);
    int[] t = new int[N + 1];
    foreach (i; 0 .. N) {
        readf("%d\n", &t[i + 1]);
    }
    auto dp = new int[][][](2, 2, N + 1);
    foreach (i; 0 .. 2) foreach (j; 0 .. 2) dp[i][j][] = L;
    dp[0][1][1] = dp[1][1][0] = 0;
    static int s(int x) { return x % 2; }
    foreach (i; 1 .. N) {
        foreach (j; 0 .. N) {
            dp[0][s(i + 1)][j + 1] = min(dp[0][s(i)][j], dp[1][s(i)][j] + t[i]);
            dp[1][s(i + 1)][j] = min(dp[0][s(i)][j] + t[i], dp[1][s(i)][j]);
        }
    }
    int ans = L;
    foreach (i; 0 .. 2) {
        ans = min(ans, dp[i][s(N)][N / 2]);
    }
    ans.writeln;
}