#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int inf = 0x3f3f3f3f;
const int finf = -0x3f3f3f3f - 1;
const int mod = 1e9 + 7;
const int L = 100005;
string add(string a, string b) {
  string ans = "";
  int na[L] = {0}, nb[L] = {0};
  int la = a.size(), lb = b.size();
  for (int i = 0; i < la; i++) na[la - 1 - i] = a[i] - '0';
  for (int i = 0; i < lb; i++) nb[lb - 1 - i] = b[i] - '0';
  int lmax = la > lb ? la : lb;
  for (int i = 0; i < lmax; i++)
    na[i] += nb[i], na[i + 1] += na[i] / 10, na[i] %= 10;
  if (na[lmax]) lmax++;
  for (int i = lmax - 1; i >= 0; i--) ans += na[i] + '0';
  return ans;
}
int n;
string s;
vector<string> v;
bool cmp(string p, string q) {
  if (p.size() != q.size()) return p.size() < q.size();
  return p < q;
}
int main() {
  cin >> n >> s;
  int l = n / 2;
  int r = n / 2 + 1;
  while (v.size() <= 5 && (l > 0 || r < n)) {
    if (s[l] != '0') v.push_back(add(s.substr(0, l), s.substr(l)));
    if (s[r] != '0') v.push_back(add(s.substr(0, r), s.substr(r)));
    l--, r++;
  }
  for (int i = 0; i < v.size() - 1; i++) {
    for (int j = i + 1; j < v.size(); j++) {
      if (!cmp(v[i], v[j])) swap(v[i], v[j]);
    }
  }
  cout << v[0] << endl;
  return 0;
}
