#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int n;
string d, ans;
vector<int> v;
string findSum(string str1, string str2) {
  if (str1.length() > str2.length()) swap(str1, str2);
  string str = "";
  int n1 = str1.length(), n2 = str2.length();
  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  int carry = 0;
  for (int i = 0; i < n1; i++) {
    int sum = ((str1[i] - '0') + (str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (int i = n1; i < n2; i++) {
    int sum = ((str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry) str.push_back(carry + '0');
  reverse(str.begin(), str.end());
  return str;
}
string cut(int idx) {
  return findSum(d.substr(0, idx), d.substr(idx, n - idx));
}
string smaller(string a, string b) {
  if (a.size() != b.size()) return (a.size() < b.size()) ? a : b;
  int t = 0;
  while (t < a.size()) {
    if (a[t] > b[t])
      return b;
    else if (b[t] > a[t])
      return a;
    t++;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> d;
  if (n & 1) {
    int idx = n / 2;
    int t = 0;
    while (t < n / 2) {
      if (d[idx - t] != '0' or d[idx + 1 + t] != '0') {
        if (d[idx - t] != '0') v.push_back(idx - t);
        if (d[idx + 1 + t] != '0') v.push_back(idx + 1 + t);
        break;
      }
      t++;
    }
  } else {
    int idx = n / 2;
    int t = 0;
    while (t < n / 2) {
      if (d[idx - t] != '0' or d[idx + t] != '0') {
        if (d[idx - t] != '0') v.push_back(idx - t);
        if (d[idx + t] != '0') v.push_back(idx + t);
        break;
      }
      t++;
    }
  }
  ans = cut(v[0]);
  for (int i = 1; i < v.size(); ++i) ans = smaller(ans, cut(v[i]));
  cout << ans << "\n";
  return 0;
}
