#include <bits/stdc++.h>
using namespace std;
string sum(string s, string t) {
  vector<int> ans(max((int)s.size(), (int)t.size()) + 1, 0);
  for (int i = (int)s.size() - 1; i >= 0; i--)
    ans[(int)s.size() - 1 - i] += s[i] - '0';
  for (int i = (int)t.size() - 1; i >= 0; i--)
    ans[(int)t.size() - 1 - i] += t[i] - '0';
  int p = 0;
  for (int i = 0; i < ans.size(); i++) {
    int ost = (p + ans[i]) % 10;
    p = (p + ans[i]) / 10;
    ans[i] = ost;
  }
  while (ans.back() == 0) ans.pop_back();
  string u = "";
  while (!ans.empty()) {
    u += (char)('0' + ans.back());
    ans.pop_back();
  }
  return u;
}
int n;
string s;
string gett(int i) {
  string s1 = "";
  for (int x = 0; x < i; x++) s1 += s[x];
  string s2 = "";
  for (int x = i; x < n; x++) s2 += s[x];
  return sum(s1, s2);
}
bool my_comp(string a, string b) {
  if ((int)a.size() != (int)b.size()) return (int)a.size() < (int)b.size();
  return (a < b);
}
int main() {
  cin >> n;
  cin >> s;
  int cnt = 0;
  vector<int> cand;
  for (int i = n / 2; i < n && cnt < 3; i++) {
    if (s[i] != '0') {
      cand.push_back(i);
      cnt++;
    }
  }
  cnt = 0;
  for (int i = n / 2; i >= 0 && cnt < 3; i--) {
    if (s[i] != '0') {
      cand.push_back(i);
      cnt++;
    }
  }
  vector<string> v;
  for (int i = 0; i < cand.size(); i++) v.push_back(gett(cand[i]));
  sort(v.begin(), v.end(), my_comp);
  cout << v[0] << endl;
  return 0;
}
