#include <bits/stdc++.h>
using namespace std;
int L;
string N;
string _add(string a, string b) {
  string res = "";
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  int upper = 0;
  while (a.length() < b.length()) {
    a += '0';
  }
  while (b.length() < a.length()) {
    b += '0';
  }
  for (int i = 0; i < a.length(); i++) {
    int x = (a[i] - '0' + b[i] - '0' + upper);
    res += (x % 10) + '0';
    upper = x / 10;
  }
  if (upper) res += '0';
  reverse(res.begin(), res.end());
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> L >> N;
  string ans = N;
  for (int i = L / 2; i >= 0; i--) {
    string tmp = "";
    if (N[i] != '0') {
      tmp = _add(N.substr(0, i), N.substr(i));
      if (ans.length() > tmp.length() ||
          (ans.length() == tmp.length() && ans > tmp))
        ans = tmp;
      break;
    }
  }
  for (int i = L / 2 + 1; i < L; i++) {
    string tmp = "";
    if (N[i] != '0') {
      tmp = _add(N.substr(0, i), N.substr(i));
      if (ans.length() > tmp.length() ||
          (ans.length() == tmp.length() && ans > tmp))
        ans = tmp;
      break;
    }
  }
  cout << ans << '\n';
  return 0;
}
