#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n;
char s[MAXN];
struct Big {
  int a[MAXN], len;
  Big() {
    len = 0;
    memset(a, 0, sizeof(a));
  }
  void cat(int l, int r) {
    memset(a, 0, sizeof(a));
    len = r - l + 1;
    for (int i = l; i <= r; i++) a[r - i] = s[i] - '0';
  }
  Big operator+(const Big &b) const {
    Big c;
    c.len = max(len, b.len);
    for (int i = 0; i < c.len; i++) {
      c.a[i] += a[i] + b.a[i];
      if (c.a[i] >= 10) ++c.a[i + 1], c.a[i] -= 10;
    }
    if (c.a[c.len]) ++c.len;
    return c;
  }
  bool operator<(const Big &b) const {
    if (len != b.len) return len < b.len;
    for (int i = len - 1; i >= 0; i--)
      if (a[i] != b.a[i]) return a[i] < b.a[i];
    return 0;
  }
} x, y;
int main() {
  scanf("%d%s", &n, s + 1);
  Big res;
  bool flag = 0;
  int cnt = 5;
  for (int i = (n >> 1); i > 1; i--)
    if (s[i] != '0') {
      x.cat(1, i - 1);
      y.cat(i, n);
      x = x + y;
      if (!flag || x < res) {
        flag = 1;
        res = x;
      }
      --cnt;
      if (!cnt) break;
    }
  cnt = 5;
  for (int i = (n >> 1) + 1; i <= n; i++)
    if (s[i] != '0') {
      x.cat(1, i - 1);
      y.cat(i, n);
      x = x + y;
      if (!flag || x < res) {
        flag = 1;
        res = x;
      }
      --cnt;
      if (!cnt) break;
    }
  for (int i = res.len - 1; i >= 0; i--) putchar(res.a[i] + '0');
  return 0;
}
