#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int n, a, b = -1;
  cin >> n;
  cin >> S;
  vector<int> v(n);
  for (int i = 0; i < n; i++) v[i] = S[i] - '0';
  for (int i = 0; i < n; i++) {
    if (i <= n / 2) {
      if (v[i] != 0) a = i;
    }
    if (i > n / 2) {
      if (v[i] != 0) {
        b = i;
        break;
      }
    }
  }
  if (b == -1) {
    for (int i = 0; i < n - 2 * a; i++) cout << v[i + a];
    for (int i = 0; i < a; i++) cout << v[i];
    return 0;
  }
  if (a > n - b) {
    int k = 0, t;
    vector<int> vs(n - a, 0);
    for (int i = 0; i < n - a; i++) vs[i] = v[i + a];
    for (int i = n - a - 1; i >= n - 2 * a; i--) {
      t = vs[i] + v[i + 2 * a - n] + k;
      k = t / 10;
      vs[i] = t % 10;
    }
    int i = n - 2 * a;
    while (i > 0 && k > 0) {
      i--;
      t = vs[i] + k;
      k = t / 10;
      vs[i] = t % 10;
    }
    if (k == 1) cout << 1;
    for (int i = 0; i < n - a; i++) cout << vs[i];
  }
  if (a == n - b) {
    int t, k = 0;
    vector<int> vs1(n - a + 1, 0), vs2(b + 1, 0);
    for (int i = 1; i <= n - a + 1; i++) vs1[i] = v[i + a - 1];
    for (int i = n - a; i > n - 2 * a; i--) {
      t = vs1[i] + v[i + 2 * a - n - 1] + k;
      k = t / 10;
      vs1[i] = t % 10;
    }
    int i = n - 2 * a + 1;
    while (i > 1 && k > 0) {
      i--;
      t = vs1[i] + k;
      k = t / 10;
      vs1[i] = t % 10;
    }
    if (k == 1) vs1[0] = 1;
    k = 0;
    for (int i = 1; i <= b; i++) vs2[i] = v[i - 1];
    for (int i = b; i > 2 * b - n; i--) {
      t = vs2[i] + v[i + n - b - 1] + k;
      k = t / 10;
      vs2[i] = t % 10;
    }
    i = 2 * b - n + 1;
    while (i > 1 && k > 0) {
      i--;
      t = vs2[i] + k;
      k = t / 10;
      vs2[i] = t % 10;
    }
    if (k == 1) vs2[0] = 1;
    i = 0;
    while (i <= b && vs1[i] == vs2[i]) i++;
    if (i == b + 1 || vs2[i] > vs1[i]) {
      if (vs1[0] == 1) cout << 1;
      for (int i = 1; i <= b; i++) cout << vs1[i];
      return 0;
    }
    if (vs1[i] > vs2[i]) {
      if (vs2[0] == 1) cout << 1;
      for (int i = 1; i <= b; i++) cout << vs2[i];
      return 0;
    }
  }
  if (a < n - b) {
    int k = 0, t;
    vector<int> vs(b, 0);
    for (int i = 0; i < b; i++) vs[i] = v[i];
    for (int i = b - 1; i >= 2 * b - n; i--) {
      t = vs[i] + v[i + n - b] + k;
      k = t / 10;
      vs[i] = t % 10;
    }
    int i = 2 * b - n;
    while (i > 0 && k > 0) {
      i--;
      t = vs[i] + k;
      k = t / 10;
      vs[i] = t % 10;
    }
    if (k == 1) cout << 1;
    for (int i = 0; i < b; i++) cout << vs[i];
  }
}
