#include <bits/stdc++.h>
using namespace std;
long long p[1000005];
string ct(string a, string b) {
  long long c = 0;
  string s;
  long long na = a.length();
  long long nb = b.length();
  long long mn = min(na, nb);
  long long mx = max(na, nb);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  for (long long i = 0; i < mn; i++) {
    long long v = a[i] - '0' + b[i] - '0' + c;
    long long ch = v % 10;
    char chh = ch + '0';
    s = (chh) + s;
    c = (v - ch) / 10;
  }
  for (long long i = mn; i < mx; i++) {
    if (na == mx) {
      long long v = a[i] - '0' + c;
      long long ch = v % 10;
      char chh = ch + '0';
      s = (chh) + s;
      c = (v - ch) / 10;
    } else {
      long long v = b[i] - '0' + c;
      long long ch = v % 10;
      char chh = ch + '0';
      s = (chh) + s;
      c = (v - ch) / 10;
    }
  }
  if (c == 1) {
    s = '1' + s;
    c = 0;
  }
  return s;
}
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string sa, sb, sc, sd;
  for (long long i = 0; i < n / 2; i++) {
    sa = sa + s[i];
  }
  long long j = n / 2;
  while (s[j] == '0') {
    sa = sa + s[j];
    j++;
  }
  for (long long i = j; i < n; i++) {
    sb = sb + s[i];
  }
  for (long long i = n - 1; i > n / 2; i--) {
    sc = s[i] + sc;
  }
  j = n / 2;
  while (s[n / 2 + 1] == '0' && s[j] == '0') {
    sc = s[j] + sc;
    j--;
  }
  if (s[n / 2 + 1] == '0') {
    sc = s[j] + sc;
    j--;
  }
  for (long long i = j; i >= 0; i--) {
    sd = s[i] + sd;
  }
  string s1 = ct(sa, sb);
  string s2 = ct(sb, sa);
  string s3 = ct(sc, sd);
  string s4 = ct(sd, sc);
  map<long long, string> mp;
  mp[s1.length()] = s1;
  if (mp[s2.length()] == "") {
    mp[s2.length()] = s2;
  } else {
    mp[s2.length()] = min(mp[s2.length()], s2);
  }
  if (mp[s3.length()] == "") {
    mp[s3.length()] = s3;
  } else {
    mp[s3.length()] = min(mp[s3.length()], s3);
  }
  if (mp[s4.length()] == "") {
    mp[s4.length()] = s4;
  } else {
    mp[s4.length()] = min(mp[s4.length()], s4);
  }
  cout << ((mp.begin()->second)) << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) solve();
}
