#include <bits/stdc++.h>
using namespace std;
int n, a[100002], b[100002], c1[100002], c2[100002];
char s[100002];
void adun(int a[], int b[], int c[]) {
  c[0] = max(a[0], b[0]);
  int t = 0;
  for (int i = 1; i <= min(a[0], b[0]); i++) {
    int aux = a[i] + b[i] + t;
    c[i] = aux % 10;
    t = aux / 10;
  }
  if (a[0] > b[0]) {
    for (int i = min(a[0], b[0]) + 1; i <= a[0]; i++) {
      int aux = a[i] + t;
      c[i] = aux % 10;
      t = aux / 10;
    }
  }
  if (a[0] < b[0]) {
    for (int i = min(a[0], b[0]) + 1; i <= b[0]; i++) {
      int aux = b[i] + t;
      c[i] = aux % 10;
      t = aux / 10;
    }
  }
  if (t > 0) c[++c[0]] = t;
}
int compar(int a[], int b[]) {
  if (a[0] < b[0]) return -1;
  if (a[0] > b[0]) return 1;
  for (int i = a[0]; i >= 1; i--) {
    if (a[i] < b[i]) return -1;
    if (a[i] > b[i]) return 1;
  }
  return 0;
}
int main() {
  cin >> n;
  cin >> (s + 1);
  int Min = 2 * n;
  for (int i = 1; i < n; i++) {
    Min = min(Min, max(i, n - i) + 1);
  }
  int st, dr;
  if (n % 2 == 0) {
    st = dr = n / 2;
  } else
    st = n / 2, dr = n / 2 + 1;
  while (st >= 1 && dr < n) {
    bool ok1 = 0, ok2 = 0;
    if (s[st + 1] != '0') {
      ok1 = 1;
      a[0] = b[0] = c1[0] = 0;
      for (int i = st; i >= 1; i--) a[++a[0]] = s[i] - '0';
      for (int i = n; i > st; i--) b[++b[0]] = s[i] - '0';
      adun(a, b, c1);
    }
    if (s[dr + 1] != '0') {
      ok2 = 1;
      a[0] = b[0] = c2[0] = 0;
      for (int i = dr; i >= 1; i--) a[++a[0]] = s[i] - '0';
      for (int i = n; i > dr; i--) b[++b[0]] = s[i] - '0';
      adun(a, b, c2);
    }
    if (ok1 == 1 && ok2 == 1) {
      int t = compar(c1, c2);
      if (t == -1)
        for (int i = c1[0]; i >= 1; i--) cout << c1[i];
      else
        for (int i = c2[0]; i >= 1; i--) cout << c2[i];
      break;
    } else if (ok1 == 1) {
      for (int i = c1[0]; i >= 1; i--) cout << c1[i];
      break;
    } else if (ok2 == 1) {
      for (int i = c2[0]; i >= 1; i--) cout << c2[i];
      break;
    }
    st--;
    dr++;
    Min++;
  }
  return 0;
}
