#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
char a1[MAXN], b1[MAXN], s[MAXN];
int a[MAXN], b[MAXN], c[MAXN];
int ans1[MAXN], ans2[MAXN];
int a1_len, b1_len, lenc, i, x, len1, len2, len;
int main() {
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(c, 0, sizeof(c));
  cin >> len;
  scanf("%s", s);
  int le, ri;
  bool flag = false;
  le = len / 2 - 1, ri = len / 2;
  while (s[le + 1] == '0') le--;
  while (s[ri] == '0') ri++, flag = true;
  for (i = 0; i <= le; i++) a1[i] = s[i];
  for (i = le + 1; i < len; i++) b1[i - le - 1] = s[i];
  if (s[le + 1] == '0' || le == -1)
    len1 = MAXN + 5;
  else {
    a1_len = strlen(a1);
    b1_len = strlen(b1);
    for (i = 0; i <= a1_len - 1; i++) {
      a[a1_len - i] = a1[i] - 48;
    }
    for (i = 0; i <= b1_len - 1; i++) {
      b[b1_len - i] = b1[i] - 48;
    }
    lenc = 1;
    x = 0;
    while (lenc <= a1_len || lenc <= b1_len) {
      c[lenc] = a[lenc] + b[lenc] + x;
      x = c[lenc] / 10;
      c[lenc] = c[lenc] % 10;
      lenc++;
    }
    c[lenc] = x;
    if (c[lenc] == 0) {
      lenc--;
    }
    len1 = lenc;
    for (i = len1; i >= 1; i--) {
      ans1[i] = c[i];
    }
  }
  if (s[ri] == '0' || ri > len)
    len2 = MAXN + 5;
  else {
    memset(a1, 0, sizeof(a1));
    memset(b1, 0, sizeof(b1));
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    memset(c, 0, sizeof(c));
    if (flag) {
      for (i = 0; i < ri; i++) a1[i] = s[i];
      for (i = ri; i < len; i++) b1[i - ri] = s[i];
    } else {
      for (i = 0; i <= ri; i++) a1[i] = s[i];
      for (i = ri + 1; i < len; i++) b1[i - ri - 1] = s[i];
    }
    a1_len = strlen(a1);
    b1_len = strlen(b1);
    for (i = 0; i <= a1_len - 1; i++) {
      a[a1_len - i] = a1[i] - 48;
    }
    for (i = 0; i <= b1_len - 1; i++) {
      b[b1_len - i] = b1[i] - 48;
    }
    lenc = 1;
    x = 0;
    while (lenc <= a1_len || lenc <= b1_len) {
      c[lenc] = a[lenc] + b[lenc] + x;
      x = c[lenc] / 10;
      c[lenc] = c[lenc] % 10;
      lenc++;
    }
    c[lenc] = x;
    if (c[lenc] == 0) {
      lenc--;
    }
    len2 = lenc;
    for (i = len2; i >= 1; i--) {
      ans2[i] = c[i];
    }
  }
  if (len1 > len2) {
    for (i = len2; i >= 1; i--) {
      cout << ans2[i];
    }
  } else if (len1 < len2) {
    for (i = len1; i >= 1; i--) {
      cout << ans1[i];
    }
  } else {
    int *ans = ans1;
    for (i = len1; i >= 1; i--) {
      if (ans2[i] == ans1[i]) continue;
      if (ans2[i] < ans1[i]) {
        ans = ans2;
        break;
      } else
        break;
    }
    for (i = len1; i >= 1; i--) {
      cout << ans[i];
    }
  }
  cout << endl;
  return 0;
}
