#include <bits/stdc++.h>
using namespace std;
std::mt19937 rng(
    (int)std::chrono::steady_clock::now().time_since_epoch().count());
const double EPS = 1e-9;
const double PI = acos(-1);
const int MOD = 1000000007;
int toInt(char c) { return c - '0'; }
string sum(string a, string b) {
  if (int(a.size()) > int(b.size())) swap(a, b);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  string ans;
  int carry = 0;
  for (int i = 0; i < int(a.size()); i++) {
    int sum = toInt(a[i]) + toInt(b[i]) + carry;
    ans += char(sum % 10 + '0');
    carry = sum / 10;
  }
  for (int i = int(a.size()); i < int(b.size()); i++) {
    int sum = toInt(b[i]) + carry;
    ans += char(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry > 0) ans += char('0' + carry);
  reverse(ans.begin(), ans.end());
  return ans;
}
bool menor(string a, string b) {
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  while (int(a.size()) < int(b.size())) a += '0';
  while (int(b.size()) < int(a.size())) b += '0';
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  return a < b;
}
int main() {
  if (!false) {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  }
  int l;
  string ans, s, aux;
  cin >> l >> s;
  ans = s;
  int meio = l / 2;
  if (s[meio] != '0') {
    aux = sum(s.substr(0, meio), s.substr(meio));
    if (false) printf("Aux: %s\n", aux.c_str());
    if (menor(aux, ans)) ans = aux;
  }
  meio++;
  while ((meio < l) and (s[meio] == '0')) meio++;
  aux = sum(s.substr(0, meio), s.substr(meio));
  if (false) printf("Aux: %s\n", aux.c_str());
  if (menor(aux, ans)) ans = aux;
  meio = l / 2;
  meio--;
  while ((meio >= 0) and (s[meio] == '0')) meio--;
  aux = sum(s.substr(0, meio), s.substr(meio));
  if (false) printf("Aux: %s\n", aux.c_str());
  if (menor(aux, ans)) ans = aux;
  cout << ans << '\n';
  return 0;
}
