#include <bits/stdc++.h>
using namespace std;
string cal(string a, string b) {
  string ans = "";
  int pos1 = a.size() - 1, pos2 = b.size() - 1;
  int last = 0, x = 0;
  while (1) {
    if (pos1 < 0 && pos2 < 0) break;
    if (pos1 < 0 && pos2 >= 0) {
      while (pos2 >= 0) {
        x = b[pos2--] - '0' + last;
        if (x >= 10) {
          last = x / 10;
          x %= 10;
        } else
          last = 0;
        ans += x + '0';
      }
      break;
    }
    if (pos2 < 0 && pos1 >= 0) {
      while (pos1 >= 0) {
        x = a[pos1--] - '0' + last;
        if (x >= 10) {
          last = x / 10;
          x %= 10;
        } else
          last = 0;
        ans += x + '0';
      }
      break;
    }
    x = a[pos1--] - '0' + b[pos2--] - '0' + last;
    if (x >= 10) {
      last = x / 10;
      x %= 10;
    } else
      last = 0;
    ans += x + '0';
  }
  if (last) ans += last + '0';
  return ans;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int pos1 = n / 2, pos2 = n / 2 + 1;
  while (s[pos1] == '0' && pos1 > 0) pos1--;
  while (s[pos2] == '0' && pos2 < n - 1) pos2++;
  string a = s.substr(0, pos1);
  string b = s.substr(pos1, s.size());
  string ans = cal(a, b);
  reverse(ans.begin(), ans.end());
  string aa = s.substr(0, pos2);
  string bb = s.substr(pos2, s.size());
  string anss = cal(aa, bb);
  reverse(anss.begin(), anss.end());
  if (s[pos2] == '0') return cout << ans << endl, 0;
  if (ans.size() < anss.size())
    cout << ans << endl;
  else if (ans.size() > anss.size())
    cout << anss << endl;
  else {
    if (ans < anss)
      cout << ans << endl;
    else
      cout << anss << endl;
  }
  return 0;
}
