#include <bits/stdc++.h>
using namespace std;
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;
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  int idx = (n + 1) / 2;
  while (idx < n && s[idx] == '0') idx++;
  if (idx == n) {
    idx--;
    while (s[idx] == '0') idx--;
    if (idx == 0) {
      cout << s << endl;
    } else {
      string s1 = s.substr(0, idx);
      string s2 = s.substr(idx);
      cout << findSum(s1, s2) << endl;
    }
  } else {
    string s1 = findSum(s.substr(0, idx), s.substr(idx));
    idx--;
    while (s[idx] == '0') idx--;
    string s2 = findSum(s.substr(0, idx), s.substr(idx));
    if (s1.size() > s2.size()) {
      cout << s2 << endl;
    } else if (s1.size() < s2.size()) {
      cout << s1 << endl;
    } else {
      cout << min(s1, s2) << endl;
    }
  }
}
