#include <bits/stdc++.h>
using namespace std;
int comp(string a, string b) {
  if (a.length() < b.length())
    return 0;
  else if (a.length() > b.length())
    return 1;
  int n = a.length();
  int i = 0;
  while (i < n && a[i] == b[i]) {
    i++;
  }
  if (i == n) return 0;
  if (a[i] < b[i]) return 0;
  return 1;
}
string calcsum(string a, string b) {
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  string ans = "";
  int n = a.length();
  int m = b.length();
  int carry = 0;
  int i;
  for (i = 0; i < min(n, m); i++) {
    int tmp = (a[i] - '0') + (b[i] - '0') + carry;
    carry = 0;
    if (tmp > 9) carry = tmp / 10, tmp %= 10;
    ans.push_back(tmp + '0');
  }
  while (i < n) {
    int tmp = (a[i] - '0') + carry;
    carry = 0;
    if (tmp > 9) carry = tmp / 10, tmp %= 10;
    ans.push_back(tmp + '0');
    i++;
  }
  while (i < m) {
    int tmp = (b[i] - '0') + carry;
    carry = 0;
    if (tmp > 9) carry = tmp / 10, tmp %= 10;
    ans.push_back(tmp + '0');
    i++;
  }
  if (carry > 0) {
    ans.push_back(carry + '0');
  }
  reverse(ans.begin(), ans.end());
  return ans;
}
string getsum(string a, int ind) {
  string left;
  string right;
  int i;
  for (i = 0; i < ind; i++) {
    left.push_back(a[i]);
  }
  for (i = ind; i < (int)a.length(); i++) {
    right.push_back(a[i]);
  }
  return calcsum(left, right);
}
void test_case() {
  int n, indleft, indright;
  cin >> n;
  string a;
  cin >> a;
  indleft = n / 2;
  while (indleft >= 0 && a[indleft] == '0') {
    indleft--;
  }
  string num1 = getsum(a, indleft);
  indright = n / 2 + 1;
  while (indright < n && a[indright] == '0') {
    indright++;
  }
  string num2 = getsum(a, indright);
  int k = comp(num1, num2);
  if (k == 0) {
    cout << num1 << "\n";
  } else {
    cout << num2 << "\n";
  }
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t;
  t = 1;
  while (t--) {
    test_case();
  }
}
