#include <bits/stdc++.h>
using namespace std;
mt19937_64 mt_rnd_64(chrono::steady_clock::now().time_since_epoch().count());
long long rnd(long long l, long long r) {
  return (mt_rnd_64() % (r - l + 1)) + l;
}
const int N = 1e5 + 5;
int l, c;
string s, t1, t2, res;
bool z;
string a[10];
string sum(string s, string t) {
  int pr = 0;
  int x = 0;
  string ans = "";
  if (s.size() < t.size()) swap(s, t);
  t.insert(0, s.size() - t.size(), '0');
  reverse(s.begin(), s.end());
  reverse(t.begin(), t.end());
  for (int i = 0; i < s.size(); i++) {
    int x1 = s[i] - '0';
    int x2 = t[i] - '0';
    x = x1 + x2 + pr;
    pr = x / 10;
    x %= 10;
    ans += (char)x + '0';
  }
  if (pr != 0) ans += '1';
  reverse(ans.begin(), ans.end());
  return ans;
}
bool cmp(string s, string t) {
  if (s.size() != t.size()) return s.size() < t.size();
  return s < t;
}
int main() {
  cin >> l >> s;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '0') {
      z = 1;
      break;
    }
  if (!z) {
    if (s.size() % 2 == 0) {
      t1 = s.substr(0, s.size() / 2);
      t2 = s.substr(s.size() / 2, s.size());
      res = sum(t1, t2);
      return cout << res, 0;
    } else {
      t1 = s.substr(0, s.size() / 2);
      t2 = s.substr(s.size() / 2, s.size());
      res = sum(t1, t2);
      a[0] = res;
      t1 = s.substr(0, s.size() / 2 + 1);
      t2 = s.substr(s.size() / 2 + 1, s.size());
      res = sum(t1, t2);
      a[1] = res;
      sort(a, a + 2, cmp);
      cout << a[0];
      return 0;
    }
  } else {
    c = 0;
    int k = s.size() / 2;
    while (s[k] == '0' && k < s.size()) k++;
    if (s[k] != 0) {
      t1 = s.substr(0, k);
      t2 = s.substr(k, s.size());
      res = sum(t1, t2);
      a[c] = res;
      c++;
    }
    k = s.size() / 2;
    while (s[k] == '0' && k >= 0) k--;
    if (s[k] != 0) {
      t1 = s.substr(0, k);
      t2 = s.substr(k, s.size());
      res = sum(t1, t2);
      a[c] = res;
      c++;
    }
    sort(a, a + c, cmp);
    cout << a[0];
  }
}
