#include <bits/stdc++.h>
using namespace std;
string add(string s1, string s2) {
  if (!s1.size()) return s2;
  if (!s2.size()) return s1;
  reverse(s1.begin(), s1.end());
  reverse(s2.begin(), s2.end());
  if (s1.size() < s2.size()) {
    string s3;
    s3 = s1;
    s1 = s2;
    s2 = s3;
  }
  while (s2.size() != s1.size()) s2.push_back('0');
  int64_t x = 0, y = 0, i, j;
  string ans;
  for (i = 0; i < s1.size(); ++i) {
    x = s1[i] + s2[i] + y - 96;
    y = x / 10;
    x = x % 10;
    ans.push_back(x + '0');
  }
  if (y != 0) ans.push_back(y + '0');
  reverse(ans.begin(), ans.end());
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int64_t i, j, k, n;
  cin >> n;
  string s;
  cin >> s;
  j = n / 2;
  vector<int64_t> arr;
  arr.push_back(j);
  arr.push_back(j - 1);
  if (s[j] == '0') {
    while (s[j] == '0') {
      j--;
      if (j < 0) break;
    }
    if (j - 1 >= 0) arr.push_back(j - 1);
  }
  j = n / 2;
  if (s[j - 1] == '0') {
    j--;
    while (s[j] == '0') {
      j--;
      if (j < 0) break;
    }
    if (j - 1 >= 0) arr.push_back(j - 1);
  }
  multiset<pair<int64_t, string> > ans;
  for (i = 0; i < arr.size(); ++i) {
    string s1, s2;
    for (j = 0; j <= arr[i]; ++j) {
      s1.push_back(s[j]);
    }
    while (s[j] == '0') {
      s1.push_back(s[j]);
      j++;
      if (j >= n) break;
    }
    for (k = j; k < n; ++k) {
      s2.push_back(s[k]);
    }
    string s3 = add(s1, s2);
    ans.insert(make_pair(s3.size(), s3));
  }
  cout << (*(ans.begin())).second << "\n";
  return 0;
}
