#include <bits/stdc++.h>
using namespace std;
string sum(string s1, string s2) {
  int carry = 0, n1, n2;
  string res = "";
  n1 = s1.size() - 1;
  n2 = s2.size() - 1;
  while (1) {
    if (n1 >= 0) {
      if (n2 >= 0) {
        res.push_back(
            (char)(((s1[n1] - '0' + s2[n2] - '0' + carry) % 10) + '0'));
        carry = ((s1[n1] - '0' + s2[n2] - '0' + carry) / 10);
        n1--, n2--;
      } else {
        res.push_back((char)(((s1[n1] - '0' + carry) % 10) + '0'));
        carry = (s1[n1] - '0' + carry) / 10;
        n1--;
      }
    } else if (n2 >= 0) {
      res.push_back((char)(((s2[n2] - '0' + carry) % 10) + '0'));
      carry = (s2[n2] - '0' + carry) / 10;
      n2--;
    } else
      break;
  }
  if (carry != 0) res.push_back(carry + '0');
  reverse(res.begin(), res.end());
  return res;
}
string kom(string s1, string s2) {
  if (s1.size() > s2.size())
    return s2;
  else if (s1.size() < s2.size())
    return s1;
  else {
    int sz = 0;
    while (sz < s1.size() - 1) {
      if ((s1[sz] - '0') > (s2[sz] - '0'))
        return s2;
      else if ((s1[sz] - '0') < (s2[sz] - '0'))
        return s1;
      else
        sz++;
    }
    return s1;
  }
}
int main() {
  string s1, s2, ans, s, res;
  int mid, n, i;
  cin >> n >> s;
  ans = s;
  mid = n / 2;
  for (i = mid + 1; i < s.size(); i++) {
    if (s[i] == '0') continue;
    s1 = s.substr(0, i);
    s2 = s.substr(i);
    res = sum(s1, s2);
    ans = kom(ans, res);
    break;
  }
  for (i = mid; i >= 0; i--) {
    if (s[i] == '0') continue;
    s1 = s.substr(0, i);
    s2 = s.substr(i);
    res = sum(s1, s2);
    ans = kom(ans, res);
    break;
  }
  cout << ans << endl;
}
