#include <bits/stdc++.h>
using namespace std;
int n;
string s, res;
string Add(string s1, string s2) {
  int len = max(s1.size(), s2.size()) + 1;
  int sum, carry = 0;
  string res = "";
  while (s1.size() < len) s1 = '0' + s1;
  while (s2.size() < len) s2 = '0' + s2;
  for (int i = (len - 1); i >= (0); --i) {
    sum = s1[i] + s2[i] - 48 * 2 + carry;
    carry = sum / 10;
    res = static_cast<char>(sum % 10 + 48) + res;
  }
  while (res[0] == '0') res.erase(0, 1);
  return res;
}
string getMin(const string &s1, const string &s2) {
  if (s1.size() == s2.size()) {
    for (int i = (0); i < (s1.size()); ++i)
      if (s1[i] != s2[i]) {
        if (s1[i] < s2[i])
          return s1;
        else
          return s2;
      }
    return s1;
  } else
    return (s1.size() < s2.size() ? s1 : s2);
}
int main() {
  if (0) {
    freopen("CP.inp", "r", stdin);
    freopen("CP.out", "w", stdout);
  }
  ios_base::sync_with_stdio(false);
  cin >> n;
  cin >> s;
  int mid = n / 2;
  int l = mid - 1;
  int r = mid + 1;
  while (l > 0 && s[l] == '0') --l;
  while (r < n && s[r] == '0') ++r;
  if (l > 0) {
    cerr << s.substr(0, l) << ' ' << s.substr(l, n - l) << '\n';
    if (res == "")
      res = Add(s.substr(0, l), s.substr(l, n - l));
    else
      res = getMin(res, Add(s.substr(0, l), s.substr(l, n - l)));
  }
  if (r < n) {
    cerr << s.substr(0, r) << ' ' << s.substr(r, n - r) << '\n';
    if (res == "")
      res = Add(s.substr(0, r), s.substr(r, n - r));
    else
      res = getMin(res, Add(s.substr(0, r), s.substr(r, n - r)));
  }
  if (s[mid] != '0') {
    cerr << s.substr(0, mid) << ' ' << s.substr(mid, n - mid) << '\n';
    if (res == "")
      res = Add(s.substr(0, mid), s.substr(mid, n - mid));
    else
      res = getMin(res, Add(s.substr(0, mid), s.substr(mid, n - mid)));
  }
  cout << res << '\n';
  return 0;
}
