#include <bits/stdc++.h>
using namespace std;
char n[200000];
string comp(string s1, string s2) {
  if (s1.length() > s2.length())
    return s2;
  else if (s1.length() < s2.length()) {
    return s1;
  } else {
    for (int i = 0; i < s1.length(); i++) {
      if (s1[i] > s2[i])
        return s2;
      else if (s1[i] < s2[i])
        return s1;
    }
  }
  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();
  int diff = n2 - n1;
  int carry = 0;
  for (int i = n1 - 1; i >= 0; i--) {
    int sum = ((str1[i] - '0') + (str2[i + diff] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (int i = n2 - n1 - 1; i >= 0; 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 check(long long int pos) {
  if (n[pos] == '0') return false;
  return true;
}
int main() {
  long long int l, cur, pos, pos2, i, x;
  string s1, s2, p1, p2, fs1, fs2;
  cin >> l;
  cin >> n;
  cur = l;
  pos = 0;
  pos2 = 0;
  for (i = 1; i < l; i++) {
    if (check(i)) {
      x = max(i, l - i);
      if (x < cur) {
        cur = x;
        pos = i;
      } else if (x == cur)
        pos2 = i;
    }
  }
  for (i = 0; i < pos; i++) {
    s1.push_back(n[i]);
  }
  for (i = pos; i < l; i++) {
    s2.push_back(n[i]);
  }
  fs1 = findSum(s1, s2);
  for (i = 0; i < pos2; i++) {
    p1.push_back(n[i]);
  }
  for (i = pos2; i < l; i++) {
    p2.push_back(n[i]);
  }
  fs2 = findSum(p1, p2);
  if (pos2 == 0) {
    cout << fs1;
  } else
    cout << comp(fs1, fs2);
}
