#include <bits/stdc++.h>
using namespace std;
string getSum(string s1, string s2) {
  string res;
  int c = 0, s1i = s1.length() - 1, s2i = s2.length() - 1;
  while (s1i >= 0 && s2i >= 0) {
    int n1 = s1[s1i] - '0';
    int n2 = s2[s2i] - '0';
    int val = (n1 + n2 + c) % 10;
    c = (n1 + n2 + c > 9) ? 1 : 0;
    res += (val + '0');
    s1i--;
    s2i--;
  }
  while (s1i >= 0) {
    int n1 = s1[s1i] - '0';
    int val = (n1 + c) % 10;
    c = (n1 + c > 9) ? 1 : 0;
    res += (val + '0');
    s1i--;
  }
  while (s2i >= 0) {
    int n1 = s2[s2i] - '0';
    int val = (n1 + c) % 10;
    c = (n1 + c > 9) ? 1 : 0;
    res += (val + '0');
    s2i--;
  }
  if (c >= 1) {
    res += (c + '0');
  }
  reverse(res.begin(), res.end());
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ind = n / 2;
  if (n % 2 == 1) {
    if (s[ind] != '0') {
      string s1 = s.substr(0, ind + 1);
      string s2 = s.substr(ind);
      if (s1 < s2) {
        ind++;
      }
    }
  }
  bool nz = false;
  string s1;
  string s2;
  if (s[ind] != '0') {
    s1 = s.substr(0, ind);
    s2 = s.substr(ind);
    cout << getSum(s1, s2) << endl;
    return 0;
  } else {
    int i1;
    for (i1 = ind; i1 < n; i1++) {
      if (s[i1] != '0') {
        break;
      }
    }
    string res1, res2;
    if (i1 != n) {
      s1 = s.substr(0, i1);
      s2 = s.substr(i1);
      res1 = getSum(s1, s2);
    }
    int i2;
    for (i2 = ind; i2 >= 0; i2--) {
      if (s[i2] != '0') {
        break;
      }
    }
    if (i2 != 0) {
      s1 = s.substr(0, i2);
      s2 = s.substr(i2);
      res2 = getSum(s1, s2);
    }
    if (res1 == "" || (res1.length() > res2.length() && res2 != "")) {
      cout << res2 << endl;
      return 0;
    }
    if (res2 == "" || (res1.length() < res2.length() && res1 != "")) {
      cout << res1 << endl;
      return 0;
    }
    if (res1 > res2) {
      cout << res2 << endl;
    } else {
      cout << res1 << endl;
    }
  }
  return 0;
}
