#include <bits/stdc++.h>
using namespace std;
int length;
string origin;
string result;
bool is_bigger(string alpha, string belta) {
  if (alpha.size() > belta.size()) return true;
  if (alpha.size() < belta.size()) return false;
  int now = alpha.size();
  for (int i = now - 1; i >= 0; i--) {
    if (alpha[i] > belta[i]) return true;
    if (alpha[i] < belta[i]) return false;
  }
  return true;
}
void plus_num(int spot) {
  string alpha = origin.substr(0, spot);
  string belta = origin.substr(spot, length - spot);
  string sums;
  int start_alpha = spot - 1, start_belta = length - spot - 1;
  int mask = 0;
  while (start_alpha >= 0 || start_belta >= 0) {
    int now = 0;
    if (start_alpha >= 0) now = alpha[start_alpha] - '0';
    if (start_belta >= 0) now += belta[start_belta] - '0';
    now += mask;
    sums += now % 10 + '0';
    mask = now / 10;
    start_alpha--, start_belta--;
  }
  if (mask) sums += '1';
  if (!result.size()) result = sums;
  if (!is_bigger(sums, result)) result = sums;
}
void solve() {
  int spot = length / 2 + 1;
  int tail = spot, head = spot;
  while (origin[tail] == '0') tail--;
  while (origin[head] == '0' && head < length) head++;
  plus_num(tail);
  if (tail - 1 > 0 && origin[tail - 1] != '0') plus_num(tail - 1);
  plus_num(head);
  if (head + 1 < length && origin[head + 1] != '0') plus_num(head + 1);
  int sizer = result.size();
  for (int i = sizer - 1; i >= 0; i--) printf("%c", result[i]);
}
int main() {
  scanf("%d", &length);
  cin >> origin;
  solve();
}
