#include <bits/stdc++.h>
using namespace std;
const long long int N = 250001;
string add(string a, string b) {
  string c = "";
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  while (a.length() > b.length()) {
    b += '0';
  }
  while (a.length() < b.length()) {
    a += '0';
  }
  int carry = 0;
  for (int i = 0; i < a.length(); ++i) {
    int x = a[i] - '0';
    int y = b[i] - '0';
    int z = x + y + carry;
    carry = z / 10;
    z = z % 10;
    c += char(z + '0');
  }
  if (carry != 0) {
    c += char(carry + '0');
  }
  reverse(c.begin(), c.end());
  return (c);
}
string min(string a, string b) {
  if (a == "") {
    return (b);
  }
  if (b == "") {
    return (a);
  }
  if (a.length() < b.length()) {
    return (a);
  }
  if (a.length() > b.length()) {
    return (b);
  }
  for (int i = 0; i < a.length(); ++i) {
    if (a[i] < b[i]) {
      return (a);
    }
    if (a[i] > b[i]) {
      return (b);
    }
  }
  return (a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  string ans = "";
  long long int j = n / 2;
  while (j < n && s[j] == '0') {
    ++j;
  }
  string a = "", b = "";
  if (j < n) {
    for (int i = 0; i < j; ++i) {
      a += s[i];
    }
    for (int i = j; i < n; ++i) {
      b += s[i];
    }
    ans = add(a, b);
  }
  if (j + 1 < n && s[j + 1] != '0') {
    a = "";
    b = "";
    for (int i = 0; i <= j; ++i) {
      a += s[i];
    }
    for (int i = j + 1; i < n; ++i) {
      b += s[i];
    }
    ans = min(ans, add(a, b));
  }
  if (j - 1 > 0 && s[j - 1] != '0') {
    a = "";
    b = "";
    for (int i = 0; i < j - 1; ++i) {
      a += s[i];
    }
    for (int i = j - 1; i < n; ++i) {
      b += s[i];
    }
    ans = min(ans, add(a, b));
  }
  j = (n / 2) - 1;
  while (j > 0 && s[j] == '0') {
    --j;
  }
  if (j > 0) {
    a = "";
    b = "";
    for (int i = 0; i < j; ++i) {
      a += s[i];
    }
    for (int i = j; i < n; ++i) {
      b += s[i];
    }
    ans = min(ans, add(a, b));
  }
  if (j + 1 < n && s[j + 1] != '0') {
    a = "";
    b = "";
    for (int i = 0; i <= j; ++i) {
      a += s[i];
    }
    for (int i = j + 1; i < n; ++i) {
      b += s[i];
    }
    ans = min(ans, add(a, b));
  }
  if (j - 1 > 0 && s[j - 1] != '0') {
    a = "";
    b = "";
    for (int i = 0; i < j - 1; ++i) {
      a += s[i];
    }
    for (int i = j - 1; i < n; ++i) {
      b += s[i];
    }
    ans = min(ans, add(a, b));
  }
  cout << ans;
  return (0);
}
