#include <bits/stdc++.h>
using namespace std;
void optimizeIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
string findSum(string str1, string str2) {
  if (str1.length() > str2.length()) swap(str1, str2);
  string str = "";
  int n1 = str1.length(), n2 = str2.length();
  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  int carry = 0;
  for (int i = 0; i < n1; i++) {
    int sum = ((str1[i] - '0') + (str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (int i = n1; i < n2; i++) {
    int sum = ((str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry) str.push_back(carry + '0');
  reverse(str.begin(), str.end());
  return str;
}
string findMin(string s1, string s2) {
  if (s1.size() < s2.size()) return s1;
  if (s2.size() < s1.size()) return s2;
  if (s1 < s2) return s1;
  return s2;
}
int main() {
  optimizeIO();
  int tt = 1;
  while (tt--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int ind = -1, mini = 2000000007;
    string res = "";
    for (int i = (int)(0); i < (int)(n); i++) {
      if (s[i] != '0') {
        if (abs(i - (n - i)) < mini) {
          ind = i;
          mini = abs(i - (n - i));
        } else if (abs(i - (n - i)) == mini) {
          if (findMin(findSum(s.substr(0, ind), s.substr(ind, n - ind)),
                      findSum(s.substr(0, i), s.substr(i, n - i))) !=
              findSum(s.substr(0, ind), s.substr(ind, n - ind))) {
            ind = i;
          }
        }
      }
    }
    cout << findSum(s.substr(0, ind), s.substr(ind, n - ind));
  }
  return 0;
}
