#include <bits/stdc++.h>
using namespace std;
string solve(string a, string b) {
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  while (a.size() > b.size()) {
    b.push_back('0');
  }
  while (a.size() < b.size()) {
    a.push_back('0');
  }
  string sum;
  long long rem1 = 0, su1;
  for (int i = 0; i < a.size(); i++) {
    su1 = rem1 + int(a[i] - '0') + int(b[i] - '0');
    rem1 = su1 / 10;
    if (rem1 != 0) {
      su1 = su1 % 10;
    }
    sum.push_back(char(su1 + '0'));
  }
  if (rem1 != 0) {
    sum.push_back(char(rem1 + '0'));
  }
  while (sum.back() == '0') {
    sum.pop_back();
  }
  reverse(sum.begin(), sum.end());
  return sum;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  string s, s1, s2;
  cin >> s;
  long long i = n / 2, j = n / 2;
  while (i < n && s[i] == '0') {
    i++;
  }
  while (j > 0 && s[j] == '0') {
    j--;
  }
  if (i == n && j == 0) {
    cout << s.substr(0, n - 1) << endl;
    return 0;
  }
  if (i == n / 2) {
    if (n % 2 == 0) {
      cout << solve(s.substr(0, n / 2), s.substr(n / 2, n / 2)) << endl;
    } else {
      string temp1 = (solve(s.substr(0, n / 2), s.substr(n / 2, n / 2 + 1)));
      string temp2 = solve(s.substr(0, n / 2 + 1), s.substr(n / 2 + 1, n / 2));
      if (temp1.size() > temp2.size()) {
        cout << temp2 << endl;
      } else if (temp1.size() < temp2.size()) {
        cout << temp1 << endl;
      } else {
        cout << min(temp2, temp1) << endl;
      }
    }
  } else {
    if (j == 0) {
      cout << solve(s.substr(0, i), s.substr(i, n - i)) << endl;
      return 0;
    }
    string temp1 = solve(s.substr(0, i), s.substr(i, n - i));
    string temp2 = solve(s.substr(0, j), s.substr(j, n - j));
    if (temp1.size() > temp2.size()) {
      cout << temp2 << endl;
    } else if (temp1.size() < temp2.size()) {
      cout << temp1 << endl;
    } else {
      cout << min(temp2, temp1) << endl;
    }
  }
}
