#include <bits/stdc++.h>
using namespace std;
struct shitClass {};
template <class T>
shitClass& operator<<(shitClass& c1, const T& t) {
  return c1;
};
shitClass cerr1;
ostream& operator<<(ostream& os, const vector<long long>& a) {
  for (int i = 0; i < a.size(); i++) os << a[i] << " ";
  return os;
}
string ad(string a, string b) {
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  string c = "";
  long long ost = 0;
  for (int i = 0; i < min(a.size(), b.size()); i++) {
    long long num = (a[i] - '0') + (b[i] - '0') + ost;
    c += (num % 10) + '0';
    ost = num / 10;
  }
  if (a.size() < b.size()) {
    for (int i = a.size(); i < b.size(); i++) {
      long long num = (b[i] - '0') + ost;
      c += (num % 10) + '0';
      ost = num / 10;
    }
  } else if (b.size() < a.size()) {
    for (int i = b.size(); i < a.size(); i++) {
      long long num = (a[i] - '0') + ost;
      c += (num % 10) + '0';
      ost = num / 10;
    }
  }
  if (ost != 0) c += ost + '0';
  reverse(c.begin(), c.end());
  return c;
}
bool comparer(string a, string b) {
  if (a.size() < b.size())
    return 1;
  else if (b.size() < a.size())
    return 0;
  for (int i = 0; i < a.size(); i++) {
    if ((a[i] - '0') == (b[i] - '0')) continue;
    return (a[i] - '0') < (b[i] - '0');
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long l;
  cin >> l;
  string num;
  cin >> num;
  long long answ = (1e9 + 10);
  for (long long i = 1; i < num.size(); i++) {
    if (num[i] != '0') answ = min(answ, max(i, (long long)num.size() - i));
  }
  cerr1 << "answ = " << answ << '\n';
  vector<long long> a;
  for (long long i = 1; i < num.size(); i++) {
    if (num[i] != '0' && max(i, (long long)num.size() - i) <= answ + 1)
      a.push_back(i);
  }
  cerr1 << "a[0] = " << a[0] << '\n';
  string subOne, subTwo;
  subOne = num.substr(0, a[0]);
  subTwo = num.substr(a[0], num.size() - a[0]);
  cerr1 << subOne << " " << subTwo << '\n';
  string answer = ad(subOne, subTwo);
  cerr1 << answer << '\n';
  string curStr;
  for (int i = 1; i < a.size(); i++) {
    cerr1 << a[i] << '\n';
    subOne = num.substr(0, a[i]);
    subTwo = num.substr(a[i], num.size() - a[i]);
    cerr1 << subOne << " " << subTwo << '\n';
    string curStr = ad(subOne, subTwo);
    cerr1 << curStr << '\n';
    if (comparer(curStr, answer)) answer = curStr;
    cerr1 << answer << '\n' << '\n';
  }
  cout << answer << '\n';
  return 0;
}
