#include <bits/stdc++.h>
using namespace std;
int n;
string s;
string Add(int pos) {
  string a = s.substr(1, pos), b = s.substr(1 + pos, n - pos), c = "";
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  int sz = max(a.size(), b.size()) + 1;
  vector<int> v(sz + 1);
  v[0] = 0;
  for (int i = 1; i <= a.size(); i++) v[i] = (a[i - 1] - '0');
  for (int i = 1; i <= b.size(); i++) v[i] += (b[i - 1] - '0');
  for (int i = 1; i <= sz; i++) v[i] += v[i - 1] / 10, v[i - 1] %= 10;
  int st = sz;
  while (st > 1 && v[st] == 0) st--;
  for (int i = 1; i <= st; i++) c.push_back(v[i] + '0');
  reverse(c.begin(), c.end());
  return c;
}
string Max(string x, string y) {
  if (x.size() != y.size()) return x.size() < y.size() ? x : y;
  for (int i = 0; i < x.size(); i++)
    if (x[i] != y[i]) return x[i] < y[i] ? x : y;
  return x;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> s;
  s = "%" + s;
  string ans = "";
  for (int i = 1; i <= n; i++) ans.push_back('9');
  int Startpos = n / 2 + 1;
  while (s[Startpos + 1] == '0' && Startpos > 1) Startpos--;
  if (s[Startpos + 1] != '0') ans = Max(ans, Add(Startpos));
  Startpos = n / 2 + 1;
  while (s[Startpos + 1] == '0' && Startpos < n - 1) Startpos++;
  if (s[Startpos + 1] != '0') ans = Max(ans, Add(Startpos));
  Startpos = n / 2;
  while (s[Startpos + 1] == '0' && Startpos > 1) Startpos--;
  if (s[Startpos + 1] != '0') ans = Max(ans, Add(Startpos));
  Startpos = n / 2;
  while (s[Startpos + 1] == '0' && Startpos < n - 1) Startpos++;
  if (s[Startpos + 1] != '0') ans = Max(ans, Add(Startpos));
  cout << ans << endl;
  return 0;
}
