#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long maxn = 1e5 + 5;
long long a[maxn];
long long prex[maxn];
long long ans = 1e9 + 5;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  for (long long i = 1; i <= n; i++) prex[i] = prex[i - 1] + a[i];
  if (prex[n - 1] <= a[n]) {
    long long x, y;
    for (long long i = 1; i <= n - 1; i++) {
      x = prex[i];
      y = prex[n] - prex[i];
      ans = min(ans, y - x + 1);
    }
    cout << ans << endl;
  } else {
    cout << 0 << endl;
  }
}
