#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005], sum1[100005], sum2[100005];
char p[100005], tmp1[100005], tmp2[100005];
void jia1() {
  int i, t = 0, tmp;
  for (i = 0; i < 100005; i++) sum1[i] = a[i] + b[i];
  for (i = 0; i < 100005; i++) {
    tmp = t;
    t = (sum1[i] + t) / 10;
    sum1[i] = (sum1[i] + tmp) % 10;
  }
}
void jia2() {
  int i, t = 0, tmp;
  for (i = 0; i < 100005; i++) sum2[i] = a[i] + b[i];
  for (i = 0; i < 100005; i++) {
    tmp = t;
    t = (sum2[i] + t) / 10;
    sum2[i] = (sum2[i] + tmp) % 10;
  }
}
int main() {
  int n, sign, t = 0, i, j;
  scanf("%d", &n);
  scanf("%s", p);
  for (i = 0; i < 100005; i++) a[i] = 0, b[i] = 0, sum1[i] = 0, sum2[i] = 0;
  if (n % 2 == 0) {
    int tmp = n / 2;
    while (1) {
      if (p[tmp] != '0') {
        sign = 0;
        break;
      }
      if (p[tmp + t] != '0' && p[tmp - t] == '0') {
        sign = 1;
        break;
      }
      if (p[tmp + t] == '0' && p[tmp - t] != '0') {
        sign = 2;
        break;
      }
      if (p[tmp + t] != '0' && p[tmp - t] != '0') {
        sign = 3;
        break;
      }
      t++;
    }
    if (sign == 1) {
      tmp = tmp + t;
      for (i = n - 1, j = 0; i >= tmp; i--) a[j] = p[i] - '0', j++;
      for (i = tmp - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia1();
      for (i = 100004;; i--) {
        if (sum1[i] != 0) break;
      }
      for (; i >= 0; i--) printf("%d", sum1[i]);
    }
    if (sign == 2) {
      tmp = tmp - t;
      for (i = n - 1, j = 0; i >= tmp; i--) a[j] = p[i] - '0', j++;
      for (i = tmp - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia2();
      for (i = 100004;; i--) {
        if (sum2[i] != 0) break;
      }
      for (; i >= 0; i--) printf("%d", sum2[i]);
    }
    if (sign == 3) {
      int h = tmp + t;
      for (i = n - 1, j = 0; i >= h; i--) a[j] = p[i] - '0', j++;
      for (i = h - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia1();
      for (i = 100004;; i--) {
        if (sum1[i] != 0) break;
      }
      for (j = 0; i >= 0; i--) tmp1[j] = sum1[i] + '0', j++;
      tmp1[j] = '\0';
      for (i = 0; i < 100005; i++) a[i] = 0, b[i] = 0;
      h = tmp - t;
      for (i = n - 1, j = 0; i >= h; i--) a[j] = p[i] - '0', j++;
      for (i = h - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia2();
      for (i = 100004;; i--) {
        if (sum2[i] != 0) break;
      }
      for (j = 0; i >= 0; i--) tmp2[j] = sum2[i] + '0', j++;
      tmp2[j] = '\0';
      if (strcmp(tmp1, tmp2) > 0)
        printf("%s", tmp2);
      else
        printf("%s", tmp1);
    }
    if (sign == 0) {
      for (i = n - 1, j = 0; i >= tmp; i--) a[j] = p[i] - '0', j++;
      for (i = tmp - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia1();
      for (i = 100004;; i--) {
        if (sum1[i] != 0) break;
      }
      for (; i >= 0; i--) printf("%d", sum1[i]);
    }
  }
  if (n % 2 == 1) {
    int tmp = n / 2;
    t = 0;
    while (1) {
      if (p[tmp] != '0') {
        sign = 0;
        break;
      }
      if (p[tmp + t] != '0' && p[tmp - t] == '0') {
        sign = 1;
        break;
      }
      if (p[tmp + t] == '0' && p[tmp - t] != '0') {
        sign = 2;
        break;
      }
      if (p[tmp + t] != '0' && p[tmp - t] != '0') {
        sign = 3;
        break;
      }
      t++;
    }
    if (sign == 0) {
      int h = tmp;
      for (i = n - 1, j = 0; i >= h; i--) a[j] = p[i] - '0', j++;
      for (i = h - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia1();
      for (i = 100004;; i--) {
        if (sum1[i] != 0) break;
      }
      for (j = 0; i >= 0; i--) tmp1[j] = sum1[i] + '0', j++;
      tmp1[j] = '\0';
      for (i = 0; i < 100005; i++) a[i] = 0, b[i] = 0;
      h = tmp + 1;
      for (i = n - 1, j = 0; i >= h; i--) a[j] = p[i] - '0', j++;
      for (i = h - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia2();
      for (i = 100004;; i--) {
        if (sum2[i] != 0) break;
      }
      for (j = 0; i >= 0; i--) tmp2[j] = sum2[i] + '0', j++;
      tmp2[j] = '\0';
      if (strcmp(tmp1, tmp2) > 0)
        printf("%s", tmp2);
      else
        printf("%s", tmp1);
    }
    if (sign == 1) {
      tmp = tmp + t;
      for (i = n - 1, j = 0; i >= tmp; i--) a[j] = p[i] - '0', j++;
      for (i = tmp - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia1();
      for (i = 100004;; i--) {
        if (sum1[i] != 0) break;
      }
      for (; i >= 0; i--) printf("%d", sum1[i]);
    }
    if (sign == 2) {
      int h = tmp - t;
      for (i = n - 1, j = 0; i >= h; i--) a[j] = p[i] - '0', j++;
      for (i = h - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia1();
      for (i = 100004;; i--) {
        if (sum1[i] != 0) break;
      }
      for (j = 0; i >= 0; i--) tmp1[j] = sum1[i] + '0', j++;
      tmp1[j] = '\0';
      if (p[tmp + t + 1] == '0')
        printf("%s", tmp1);
      else {
        for (i = 0; i < 100005; i++) a[i] = 0, b[i] = 0;
        h = tmp + t + 1;
        for (i = n - 1, j = 0; i >= h; i--) a[j] = p[i] - '0', j++;
        for (i = h - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
        jia2();
        for (i = 100004;; i--) {
          if (sum2[i] != 0) break;
        }
        for (j = 0; i >= 0; i--) tmp2[j] = sum2[i] + '0', j++;
        tmp2[j] = '\0';
        if (strcmp(tmp1, tmp2) > 0)
          printf("%s", tmp2);
        else
          printf("%s", tmp1);
      }
    }
    if (sign == 3) {
      tmp = tmp + t;
      for (i = n - 1, j = 0; i >= tmp; i--) a[j] = p[i] - '0', j++;
      for (i = tmp - 1, j = 0; i >= 0; i--) b[j] = p[i] - '0', j++;
      jia1();
      for (i = 100004;; i--) {
        if (sum1[i] != 0) break;
      }
      for (; i >= 0; i--) printf("%d", sum1[i]);
    }
  }
  return 0;
}
