#include <bits/stdc++.h>
using namespace std;
string sum(string s1, string s2) {
  if (s1.length() < s2.length()) {
    swap(s1, s2);
  }
  reverse(s1.begin(), s1.end());
  reverse(s2.begin(), s2.end());
  string ans = "";
  int l = s2.length();
  int carry = 0;
  int i = 0;
  for (i = 0; i < l; i++) {
    int s = (s1[i] - '0') + (s2[i] - '0') + carry;
    int d = s % 10;
    carry = s / 10;
    ans += d + '0';
  }
  for (; i < s1.length(); i++) {
    int d = ((s1[i] - '0') + carry);
    carry = d / 10;
    d = d % 10;
    ans += d + '0';
  }
  if (carry != 0) {
    ans += carry + '0';
  }
  reverse(ans.begin(), ans.end());
  return ans;
}
bool les(string A, string B) {
  if (A.length() < B.length()) {
    return 1;
  } else if (A.length() > B.length())
    return 0;
  else {
    int i = 0;
    int n = A.length();
    while (A[i] == B[i] && i < n) i++;
    if (i == n) return 1;
    return A[i] < B[i];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int N = n / 2;
    vector<pair<string, string> > v;
    vector<int> candi;
    if (n % 2 == 0) {
      int a, b;
      a = N;
      b = N;
      candi.push_back(N);
      if (N - 1 > 0) candi.push_back(N - 1);
      if (N + 1 < n) candi.push_back(N + 1);
      while (s[b] == '0') {
        b++;
      }
      if (b != n) {
        string s1 = s.substr(0, N);
        string s2 = s.substr(b, n - b);
        v.push_back({s1, s2});
      }
      b = N;
      while (s[b] == '0') {
        b--;
      }
      if (b != 0) {
        string s1 = s.substr(0, b);
        string s2 = s.substr(b + 1, n - b);
        v.push_back({s1, s2});
      }
    } else {
      int a;
      a = N;
      candi.push_back(N);
      if (N - 1 > 0) candi.push_back(N - 1);
      if (N + 1 < n) candi.push_back(N + 1);
      if (N + 2 < n) candi.push_back(N + 2);
    }
    string ans = "";
    for (int i = 0; i < (int(candi.size())); i++) {
      int a = 0;
      int b = candi[i];
      while (s[b] == '0') {
        b++;
      }
      if (b != n) {
        string s1 = s.substr(0, b);
        string s2 = s.substr(b, n - b);
        string ss = sum(s1, s2);
        if (ans.length() == 0) {
          ans = ss;
        } else {
          bool ret = les(ss, ans);
          if (ret) ans = ss;
        }
      }
      b = candi[i];
      while (s[b] == '0') {
        b--;
      }
      if (b != 0) {
        string s1 = s.substr(0, b);
        string s2 = s.substr(b, n - b);
        string ss = sum(s1, s2);
        if (ans.length() == 0) {
          ans = ss;
        } else {
          bool ret = les(ss, ans);
          if (ret) ans = ss;
        }
      }
    }
    cout << ans;
  }
  return 0;
}
