#include <bits/stdc++.h>
using namespace std;
long long len;
long long len1, len2;
long long len3, len4;
string s1, s2;
string s3, s4;
string s;
string sum(string s1, string s2) {
  if (s1.length() < s2.length()) {
    string temp = s1;
    s1 = s2;
    s2 = temp;
  }
  int i, j;
  for (i = s1.length() - 1, j = s2.length() - 1; i >= 0; i--, j--) {
    s1[i] = char(s1[i] + (j >= 0 ? s2[j] - '0' : 0));
    if (s1[i] - '0' >= 10) {
      s1[i] = char((s1[i] - '0') % 10 + '0');
      if (i)
        s1[i - 1]++;
      else
        s1 = '1' + s1;
    }
  }
  return s1;
}
int main() {
  cin >> len;
  cin >> s;
  len1 = len;
  len2 = len;
  for (int i = 0; i < len; i++) {
    if (s[i + 1] == '0') continue;
    long long l = max((long long)(i + 1), len - i - 1);
    if (max(len1, len2) > l) {
      len1 = i + 1;
      len2 = len - i - 1;
    } else if (max(len1, len2) == l) {
      len3 = i + 1;
      len4 = len - i - 1;
    }
  }
  for (int i = 0; i < len1; i++) {
    s1 += s[i];
  }
  for (int i = len1; i < len; i++) {
    s2 += s[i];
  }
  if (max(len1, len2) == max(len3, len4)) {
    for (int i = 0; i < len3; i++) {
      s3 += s[i];
    }
    for (int i = len3; i < len; i++) {
      s4 += s[i];
    }
    s1 = sum(s1, s2);
    s3 = sum(s3, s4);
    if (s1.size() == s3.size()) {
      if (s1 > s3)
        cout << s3;
      else
        cout << s1;
    } else {
      if (s1.size() > s3.size())
        cout << s3;
      else
        cout << s1;
    }
  } else {
    s1 = sum(s1, s2);
    cout << s1;
  }
}
