#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, p, q = 0, r = 0, j = 0, a, f = 0, g = 0, e = 0, b, c, d = 0,
                      v, k, u = 0, i, l;
  cin >> n;
  char s[n + 1];
  cin >> s;
  p = n / 2;
  vector<long long int> vec, vec1, vec2, vec3;
  vector<long long int>::iterator it;
  if (n % 2 != 0) {
    q = 1;
  }
  while (s[j] != 0) {
    a = s[j];
    a = a - 48;
    r = r + 1;
    if (r > p) {
      if (a != 0 && u == 0) {
        k = j;
        u = 1;
      }
      vec1.push_back(a);
    } else {
      if (a != 0) {
        v = j;
      }
      vec.push_back(a);
    }
    j = j + 1;
  }
  a = vec1[0];
  if (a == 0) {
    vec.clear();
    vec1.clear();
    j = 0;
    while (s[j] != 0) {
      a = s[j];
      a = a - 48;
      if (j >= v) {
        vec1.push_back(a);
      } else {
        vec.push_back(a);
      }
      j = j + 1;
    }
    b = vec.size();
    c = vec1.size();
    l = b - 1;
    for (i = c - 1; i >= 0; i = i - 1) {
      d = vec1[i];
      if (l >= 0) {
        d = d + vec[l];
      }
      d = d + e;
      if (d > 9) {
        e = 1;
        vec2.push_back(d % 10);
      } else {
        e = 0;
        vec2.push_back(d);
      }
      l = l - 1;
    }
    e = 0;
    vec.clear();
    vec1.clear();
    j = 0;
    while (s[j] != 0) {
      a = s[j];
      a = a - 48;
      if (j >= k) {
        vec1.push_back(a);
      } else {
        vec.push_back(a);
      }
      j = j + 1;
    }
    b = vec.size();
    c = vec1.size();
    l = c - 1;
    for (i = b - 1; i >= 0; i = i - 1) {
      d = vec[i];
      if (l >= 0) {
        d = d + vec1[l];
      }
      d = d + e;
      if (d > 9) {
        e = 1;
        vec3.push_back(d % 10);
      } else {
        e = 0;
        vec3.push_back(d);
      }
      l = l - 1;
    }
    b = vec2.size();
    c = vec3.size();
    d = 0;
    if (b == c) {
      for (i = b - 1; i >= 0; i = i - 1) {
        if (vec2[i] > vec3[i]) {
          d = 1;
          break;
        } else if (vec2[i] < vec3[i]) {
          d = 2;
          break;
        }
      }
      if (d == 0 || d == 2) {
        for (i = b - 1; i >= 0; i = i - 1) {
          printf("%lld", vec2[i]);
        }
      } else if (d == 1) {
        for (i = c - 1; i >= 0; i = i - 1) {
          printf("%lld", vec3[i]);
        }
      }
    } else if (b == 0) {
      for (i = c - 1; i >= 0; i = i - 1) {
        printf("%lld", vec3[i]);
      }
    } else if (c == 0) {
      for (i = b - 1; i >= 0; i = i - 1) {
        printf("%lld", vec2[i]);
      }
    } else if (b > c) {
      for (i = c - 1; i >= 0; i = i - 1) {
        printf("%lld", vec3[i]);
      }
    } else if (b < c) {
      for (i = b - 1; i >= 0; i = i - 1) {
        printf("%lld", vec2[i]);
      }
    }
  } else {
    b = vec.size();
    c = vec1.size();
    e = 0;
    l = b - 1;
    for (i = c - 1; i >= 0; i = i - 1) {
      d = vec1[i];
      if (l >= 0) {
        d = d + vec[l];
      }
      d = d + e;
      if (d > 9) {
        e = (d / 10) % 10;
        vec2.push_back(d % 10);
      } else {
        e = 0;
        vec2.push_back(d);
      }
      l = l - 1;
    }
    if (e != 0) {
      vec2.push_back(e);
    }
    for (it = vec2.begin(); it != vec2.end(); it++) {
    }
    if (vec1[1] != 0 && q == 1) {
      a = vec1[0];
      vec.push_back(a);
      it = vec1.begin();
      vec1.erase(it);
      e = 0;
      b = vec.size();
      c = vec1.size();
      l = c - 1;
      for (i = b - 1; i >= 0; i = i - 1) {
        d = vec[i];
        if (l >= 0) {
          d = d + vec1[l];
        }
        d = d + e;
        if (d > 9) {
          e = (d / 10) % 10;
          vec3.push_back(d % 10);
        } else {
          e = 0;
          vec3.push_back(d);
        }
        l = l - 1;
      }
    }
    b = vec2.size();
    c = vec3.size();
    d = 0;
    if (b == c) {
      for (i = b - 1; i >= 0; i = i - 1) {
        if (vec2[i] > vec3[i]) {
          d = 1;
          break;
        } else if (vec2[i] < vec3[i]) {
          d = 2;
          break;
        }
      }
      if (d == 0 || d == 2) {
        for (i = b - 1; i >= 0; i = i - 1) {
          printf("%lld", vec2[i]);
        }
      } else if (d == 1) {
        for (i = c - 1; i >= 0; i = i - 1) {
          printf("%lld", vec3[i]);
        }
      }
    } else if (b == 0) {
      for (i = c - 1; i >= 0; i = i - 1) {
        printf("%lld", vec3[i]);
      }
    } else if (c == 0) {
      for (i = b - 1; i >= 0; i = i - 1) {
        printf("%lld", vec2[i]);
      }
    } else if (b > c) {
      for (i = c - 1; i >= 0; i = i - 1) {
        printf("%lld", vec3[i]);
      }
    } else if (b < c) {
      for (i = b - 1; i >= 0; i = i - 1) {
        printf("%lld", vec2[i]);
      }
    }
  }
}
