#include <bits/stdc++.h>
using namespace std;
bool cmp(string &a, string &b) {
  if (a.size() == b.size()) {
    return a < b;
  } else {
    return (a.size()) < b.size();
  }
}
string add(string a, string b) {
  string res = "";
  long long int l = a.size() - 1, r = b.size() - 1, carry = 0;
  while (l >= 0 && r >= 0) {
    res += char(((a[l] - '0') + (b[r] - '0') + carry) % 10 + '0');
    carry = (((a[l] - '0') + (b[r] - '0') + carry) / 10);
    r--;
    l--;
  }
  while (l >= 0) {
    res += char(((a[l] - '0') + carry) % 10 + '0');
    carry = (((a[l] - '0') + carry) / 10);
    l--;
  }
  while (r >= 0) {
    res += char(((b[r] - '0') + carry) % 10 + '0');
    carry = (((b[r] - '0') + carry) / 10);
    r--;
  }
  while (carry) {
    res += char(carry % 10 + '0');
    carry /= 10;
  }
  reverse(res.begin(), res.end());
  return res;
}
void solve() {
  long long int l;
  cin >> l;
  string n;
  cin >> n;
  long long int pos, sz = l;
  pos = sz / 2;
  long long int L = pos - 1, R = pos + 1;
  while (L >= 0 && n[L] == '0') L--;
  while (R < sz && n[R] == '0') R++;
  vector<string> v;
  if (n[pos] != '0' && pos > 0) {
    string a = "", b = "";
    for (long long int i = 0; i <= sz - 1; i++) {
      if (i < pos) {
        a += n[i];
      } else {
        b += n[i];
      }
    }
    string res = add(a, b);
    v.push_back(res);
  }
  if (L > 0 && L < pos) {
    string a = "", b = "";
    for (long long int i = 0; i <= sz - 1; i++) {
      if (i < L) {
        a += n[i];
      } else {
        b += n[i];
      }
    }
    string res = add(a, b);
    v.push_back(res);
  }
  if (R < sz && R > pos) {
    string a = "", b = "";
    for (long long int i = 0; i <= sz - 1; i++) {
      if (i < R) {
        a += n[i];
      } else {
        b += n[i];
      }
    }
    string res = add(a, b);
    v.push_back(res);
  }
  sort(v.begin(), v.end(), cmp);
  cout << v[0] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
  }
}
