#include <bits/stdc++.h>
using namespace std;
char s[100005];
int l;
void print(vector<int> v) {
  for (auto it = v.rbegin(); it != v.rend(); it++) cout << *it;
  cout << endl;
}
vector<int> get_num(int pos) {
  vector<int> v1, v2;
  for (int i = pos - 1; i >= 1; i--) v1.push_back(s[i] - '0');
  for (int i = l; i >= pos; i--) v2.push_back(s[i] - '0');
  vector<int> an;
  for (int i = 0; i < v1.size() || i < v2.size(); i++) {
    if (i >= v1.size())
      an.push_back(v2[i]);
    else if (i >= v2.size())
      an.push_back(v1[i]);
    else
      an.push_back(v1[i] + v2[i]);
  }
  int len = an.size();
  for (int i = 0; i < len; i++) {
    if (an[i] > 9) {
      if (i + 1 == an.size())
        an.push_back(1);
      else
        an[i + 1]++;
    }
    an[i] %= 10;
  }
  return an;
}
bool cmp(vector<int> v1, vector<int> v2) {
  if (v1.size() == v2.size()) {
    for (int i = v1.size() - 1; i >= 0; i--) {
      if (v1[i] != v2[i]) return v1[i] < v2[i];
    }
    return true;
  } else
    return v1.size() < v2.size();
}
int main() {
  cin >> l;
  scanf("%s", s + 1);
  int p = (l + 1) / 2;
  int p1, p2;
  p1 = p;
  p2 = p + 1;
  while (p1 >= 1 && s[p1] == '0') p1--;
  while (p2 <= l && s[p2] == '0') p2++;
  vector<int> an;
  if (p1 == 1) {
    an = get_num(p2);
  } else if (p2 > l) {
    an = get_num(p1);
  } else {
    vector<int> v1 = get_num(p1), v2 = get_num(p2);
    if (cmp(v1, v2)) {
      an = v1;
    } else
      an = v2;
  }
  print(an);
  return 0;
}
