#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end(), greater<int>());
  long long total = 0;
  for (int i = 1; i < v.size(); i++) {
    total += v[i];
  }
  long long a = v[0], b = total;
  long long l = 0;
  long long r = a;
  while (r > l + 1) {
    long long c = (l + r) / 2;
    if (a + b > c && a + c > b && b + c > a) {
      r = c;
    } else {
      l = c;
    }
  }
  cout << r;
  return 0;
}
