#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
char s[maxn];
int x[maxn], y[maxn], z[maxn];
char a[maxn], b[maxn];
int n;
bool check() {
  int la = strlen(a), lb = strlen(b);
  if (la != lb) return la < lb;
  for (int i = 0; i < la; ++i) {
    if (a[i] < b[i])
      return true;
    else if (a[i] > b[i])
      return false;
  }
  return true;
}
int main() {
  scanf("%d %s", &n, s);
  int p = -1, q = -1, k;
  for (int i = 0; i < n; ++i) {
    if (s[i] != '0') {
      if (abs(n - p * 2) > abs(n - i * 2))
        p = i;
      else if (abs(n - p * 2) == abs(n - i * 2))
        q = i;
    }
  }
  memset(x, 0, sizeof(x));
  memset(y, 0, sizeof(y));
  memset(z, 0, sizeof(z));
  for (int i = 0; i < p; ++i) x[p - 1 - i] = s[i] - '0';
  for (int i = p; i < n; ++i) y[n - 1 - i] = s[i] - '0';
  k = max(p, n - p);
  for (int i = 0; i < k; ++i) {
    z[i] += x[i] + y[i];
    z[i + 1] += z[i] / 10;
    z[i] %= 10;
  }
  if (z[k]) k += 1;
  for (int i = 0; i < k; ++i) a[k - 1 - i] = z[i] + '0';
  a[k] = '\0';
  if (q == -1)
    printf("%s\n", a);
  else {
    memset(x, 0, sizeof(x));
    memset(y, 0, sizeof(y));
    memset(z, 0, sizeof(z));
    for (int i = 0; i < q; ++i) x[q - 1 - i] = s[i] - '0';
    for (int i = q; i < n; ++i) y[n - 1 - i] = s[i] - '0';
    k = max(q, n - q);
    for (int i = 0; i < k; ++i) {
      z[i] += x[i] + y[i];
      z[i + 1] += z[i] / 10;
      z[i] %= 10;
    }
    if (z[k]) k += 1;
    for (int i = 0; i < k; ++i) b[k - 1 - i] = z[i] + '0';
    b[k] = '\0';
    if (check())
      printf("%s\n", a);
    else
      printf("%s\n", b);
  }
}
