#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
long long N = 1e6 * 5;
long double EPS = 1 / 1e9;
long long a[100005], ans[100005], ans1[100005];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    char x;
    cin >> x;
    a[i] = x - '0';
  }
  long long m = n / 2 + 1, m1, k = 0, ost = 0, sz, sz1, check = 0;
  for (; !a[m];) m++;
  m--;
  m1 = m;
  for (long long i = n - 1; i > m1; i--, m--, k++) {
    ans[k] = (a[i] + a[m] + ost) % 10;
    ost = (a[i] + a[m] + ost) / 10;
  }
  for (; m >= 0; m--) {
    ans[k] = (a[m] + ost) % 10;
    ost = (a[m] + ost) / 10;
    k++;
  }
  sz = k - 1;
  m = n / 2;
  k = 0;
  ost = 0;
  for (; !a[m];) m--;
  m1 = n - 1;
  for (long long i = m - 1; i >= 0; i--, k++, m1--) {
    ans1[k] += (a[i] + a[m1] + ost) % 10;
    ost = (a[i] + a[m1] + ost) / 10;
  }
  for (; m1 >= m; m1--) {
    ans1[k] = (a[m1] + ost) % 10;
    ost = (a[m1] + ost) / 10;
    k++;
  }
  sz1 = k - 1;
  if (sz < sz1)
    check = 1;
  else if (sz > sz1)
    check = 2;
  else {
    for (long long i = sz; i >= 0; i--)
      if (ans[i] < ans1[i]) {
        check = 1;
        break;
      } else if (ans[i] > ans1[i]) {
        check = 2;
        break;
      }
  }
  if (check == 1) {
    for (long long i = sz; i >= 0; i--) cout << ans[i];
  } else {
    for (long long i = sz1; i >= 0; i--) cout << ans1[i];
  }
  return 0;
}
