#include <bits/stdc++.h>
using namespace std;
int n, c, cur;
string str;
string go(int foo) {
  string a = "";
  int b_1 = foo - 1;
  int b_2 = n - 1;
  while (b_1 >= 0 && b_2 >= foo) {
    cur = str[b_1] - '0' + str[b_2] - '0' + c;
    c = cur / 10;
    a.push_back(cur % 10 + '0');
    b_1--;
    b_2--;
  }
  while (b_1 >= 0) {
    cur = str[b_1] - '0' + c;
    c = cur / 10;
    a.push_back(cur % 10 + '0');
    b_1--;
  }
  while (b_2 >= foo) {
    cur = str[b_2] - '0' + c;
    c = cur / 10;
    a.push_back(cur % 10 + '0');
    b_2--;
  }
  if (c != 0) a.push_back(c + '0');
  return a;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> str;
  int mi = n / 2;
  if (str[mi] != '0') {
    if (n & 1) {
      string a = go(mi);
      reverse(a.begin(), a.end());
      string b = go(mi + 1);
      reverse(b.begin(), b.end());
      if (a.compare(b) < 0)
        cout << a << endl;
      else
        cout << b << endl;
    } else {
      string a = go(mi);
      reverse(a.begin(), a.end());
      cout << a << endl;
    }
  } else {
    int idx_1 = mi;
    int idx_2 = mi;
    while (str[idx_1] == '0' && idx_1 >= 0) idx_1--;
    while (str[idx_2] == '0' && idx_2 < n) idx_2++;
    idx_1--;
    int sz_1 = idx_1 + 1;
    int sz_2 = n - idx_2;
    if (sz_1 == sz_2) {
      string a = go(idx_1 + 1);
      string b = go(idx_2);
      reverse(a.begin(), a.end());
      reverse(b.begin(), b.end());
      if (a.compare(b) < 0)
        cout << a << endl;
      else
        cout << b << endl;
    } else if (sz_1 > sz_2) {
      string a = go(idx_1 + 1);
      reverse(a.begin(), a.end());
      cout << a << endl;
    } else {
      string a = go(idx_2);
      reverse(a.begin(), a.end());
      cout << a << endl;
    }
  }
  return 0;
}
