#include <bits/stdc++.h>
using namespace std;
int t[102] = {};
int main() {
  int c, n, s, k;
  cin >> n;
  c = n;
  while (c--) {
    cin >> t[c];
    t[c] += t[c + 1];
  }
  cin >> s >> c;
  if (s > c) swap(s, c);
  k = t[n - c + 1] - t[n - s + 1];
  cout << min(k, *t - k);
}
