#include <bits/stdc++.h>
using namespace std;
string add(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 mn(string s1, string s2) {
  if (s1 == "a")
    return s2;
  else if (s2 == "a")
    return s1;
  if (s1.length() < s2.length())
    return s1;
  else if (s1.length() > s2.length())
    return s2;
  else {
    if (s1 < s2)
      return s1;
    else
      return s2;
  }
}
int main() {
  int l;
  cin >> l;
  string s;
  cin >> s;
  int lt, rt;
  if (l % 2 == 0) {
    lt = l / 2 - 1;
    rt = l / 2;
    string a1 = "a", a2 = "a";
    while (rt < l && s[rt] == '0') {
      rt++;
      lt++;
    }
    if (rt < l) {
      string n1 = s.substr(0, lt + 1);
      string n2 = s.substr(rt, l - rt);
      a1 = add(n1, n2);
    }
    lt = l / 2 - 1;
    rt = l / 2;
    while (rt >= 0 && s[rt] == '0') {
      rt--;
      lt--;
    }
    if (lt >= 0) {
      string n1 = s.substr(0, lt + 1);
      string n2 = s.substr(rt, l - rt);
      a2 = add(n1, n2);
    }
    cout << mn(a1, a2);
  } else {
    rt = l / 2;
    lt = l / 2 - 1;
    if (s[rt] != '0' && s[rt + 1] != '0') {
      string n1 = s.substr(0, lt + 1);
      string n2 = s.substr(rt, l - rt);
      string a1 = add(n1, n2);
      rt++;
      lt++;
      n1 = s.substr(0, lt + 1);
      n2 = s.substr(rt, l - rt);
      string a2 = add(n1, n2);
      cout << mn(a1, a2);
    } else {
      while (rt < l && s[rt] == '0') {
        rt++;
        lt++;
      }
      string a1 = "a", a2 = "a";
      if (rt < l) {
        string n1 = s.substr(0, lt + 1);
        string n2 = s.substr(rt, l - rt);
        a1 = add(n1, n2);
      }
      rt = l / 2;
      lt = l / 2 - 1;
      while (rt >= 0 && s[rt] == '0') {
        rt--;
        lt--;
      }
      if (lt >= 0) {
        string n1 = s.substr(0, lt + 1);
        string n2 = s.substr(rt, l - rt);
        a2 = add(n1, n2);
      }
      cout << mn(a1, a2);
    }
  }
  return 0;
}
