#include <bits/stdc++.h>
using namespace std;
long long arr1[100005];
long long arr2[100005];
long long arr3[100005];
string check(string s1, string s2) {
  long long n1, n2;
  n1 = s1.length();
  n2 = s2.length();
  if (n1 > n2) return s2;
  if (n1 < n2) return s1;
  for (long long i = 0; i < n1; i++) {
    if (s1[i] < s2[i])
      return s1;
    else if (s1[i] > s2[i])
      return s2;
  }
  return s1;
}
string add(string s1, string s2) {
  long long n1, n2;
  n1 = s1.length();
  n2 = s2.length();
  if (n1 == 0) return s2;
  if (n2 == 0) return s1;
  if (n1 < n2) {
    swap(s1, s2);
    n1 = s1.length();
    n2 = s2.length();
  }
  long long i = n1 - 1, j = n2 - 1;
  string ans = "";
  long long c = 0;
  while (j >= 0) {
    long long a = s1[i] - '0', b = s2[j] - '0';
    long long sum = a + b + c;
    long long rem = sum % 10;
    c = sum / 10;
    string dig(1, '0' + rem);
    ans = dig + ans;
    j--;
    i--;
  }
  while (i >= 0) {
    long long a = s1[i] - '0';
    long long sum = a + c;
    long long rem = sum % 10;
    c = sum / 10;
    string dig(1, '0' + rem);
    ans = dig + ans;
    i--;
  }
  if (c > 0) {
    string dig(1, '0' + c);
    ans = dig + ans;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string str;
  string a1, a2;
  cin >> str;
  string ans;
  string sum;
  for (long long i = 0; i < 1e5 + 2; i++) ans += "9";
  long long mid = n / 2;
  while (str[mid] == '0') mid++;
  if (str[n / 2] == '0') {
    long long m = n / 2;
    long long j = m;
    while (j < n && str[j] == '0') j++;
    a1 = str.substr(0, j);
    a2 = str.substr(j, n - j);
    sum = add(a1, a2);
    if (a1[0] != '0' && a2[0] != '0') ans = check(ans, sum);
    j = m;
    while (j >= 0 && str[j] == '0') j--;
    a1 = str.substr(0, j);
    a2 = str.substr(j, n - j);
    sum = add(a1, a2);
    if (a1[0] != '0' && a2[0] != '0') ans = check(ans, sum);
  } else {
    long long m = n / 2;
    long long j = m;
    if (1) {
      for (long long i = -2; i < 2; i++) {
        if (j + i < 0 || j + i >= n) continue;
        a1 = str.substr(0, (j + i));
        a2 = str.substr((j + i), n - (j + i));
        sum = add(a1, a2);
        if (a1[0] != '0' && a2[0] != '0') ans = check(ans, sum);
      }
    }
  }
  cout << ans << '\n';
}
