#include <bits/stdc++.h>
using namespace std;
string strcopy(string s, int st, int endd) {
  string s1;
  for (int i = st; i <= endd; i++) s1 += s[i];
  return s1;
}
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;
}
bool isValid(string s, int i) {
  if (s[i] == '0') return false;
  return true;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string s1;
  string s2;
  string minS;
  int minL = INT_MAX;
  for (int i = n / 2; i < n; i++) {
    string s3;
    if (i + 1 > minL || (n - i - 2) > minL) continue;
    if (!isValid(s, i + 1)) continue;
    s1 = strcopy(s, 0, i);
    s2 = strcopy(s, i + 1, n - 1);
    s3 = findSum(s1, s2);
    int l = s3.size();
    if (l < minL) {
      minS = s3;
      minL = l;
    } else if (l == minL) {
      if (s3.compare(minS) < 0) {
        minS = s3;
        minL = l;
      }
    }
  }
  for (int i = n / 2 - 1; i >= 0; i--) {
    string s3;
    if (i + 1 > minL || (n - i - 2) > minL) continue;
    if (!isValid(s, i + 1)) continue;
    s1 = strcopy(s, 0, i);
    s2 = strcopy(s, i + 1, n - 1);
    s3 = findSum(s1, s2);
    int l = s3.size();
    if (l < minL) {
      minS = s3;
      minL = l;
    } else if (l == minL) {
      if (s3.compare(minS) < 0) {
        minS = s3;
        minL = l;
      }
    }
  }
  cout << minS;
}
