#include <bits/stdc++.h>
using namespace std;
long long int xpow(long long int n, long long int m) {
  if (m == 0) {
    return 1;
  } else {
    long long int x = xpow(n, m / 2);
    if (m & 1) {
      return x * x * n;
    } else {
      return x * x;
    }
  }
}
long long int xmod(long long int a, long long int m) {
  return (((a % m) + m) % m);
}
long long int xmodpow(long long int n, long long int m) {
  if (m == 0) {
    return 1;
  } else {
    long long int x = xmodpow(n, m / 2);
    if (m & 1) {
      return (
          ((((((((x % 1000000007) + 1000000007) % 1000000007) *
               (((x % 1000000007) + 1000000007) % 1000000007) % 1000000007) +
              1000000007) %
             1000000007) *
            (((n % 1000000007) + 1000000007) % 1000000007) % 1000000007) +
           1000000007) %
          1000000007);
    } else {
      return ((((((x % 1000000007) + 1000000007) % 1000000007) *
                (((x % 1000000007) + 1000000007) % 1000000007) % 1000000007) +
               1000000007) %
              1000000007);
    }
  }
}
string sum(string str1, string str2) {
  if (str1.length() > str2.length()) swap(str1, str2);
  string str = "";
  int n1 = str1.length(), n2 = str2.length();
  int diff = n2 - n1;
  int carry = 0;
  for (int i = n1 - 1; i >= 0; i--) {
    int sum = ((str1[i] - '0') + (str2[i + diff] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (int i = n2 - n1 - 1; i >= 0; i--) {
    int sum = ((str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry) str.push_back(carry + '0');
  reverse(str.begin(), str.end());
  return str;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  string a, b, c, d;
  a = b = c = d = "";
  if (n & 1) {
    int ind1 = 0;
    if (s[n / 2] == '0') {
      for (int i = (n / 2) - 1; i >= 0; i--) {
        if (s[i] != '0') {
          ind1 = i;
          break;
        }
      }
      int ind = n / 2;
      while (s[ind + 1] == '0') {
        ind++;
      }
      ind++;
      for (int i = 0; i < max(n / 2, ind); i++) {
        a += s[i];
      }
      for (int i = max(n / 2, ind); i < n; i++) {
        b += s[i];
      }
      for (int i = 0; i < ind1; i++) {
        c += s[i];
      }
      for (int i = ind1; i < n; i++) {
        d += s[i];
      }
      string x = sum(a, b);
      string y = sum(c, d);
      if (x.length() > y.length()) {
        cout << setprecision(10) << y << endl;
        return 0;
      } else if (x.length() < y.length()) {
        cout << setprecision(10) << x << endl;
        return 0;
      }
      if (x < y) {
        cout << setprecision(10) << x << endl;
      } else {
        cout << setprecision(10) << y << endl;
      }
    } else if (s[(n / 2) + 1] == '0') {
      for (int i = n / 2; i < n; i++) {
        b += s[i];
      }
      for (int i = 0; i < n / 2; i++) {
        a += s[i];
      }
      cout << setprecision(10) << sum(a, b) << endl;
    } else {
      for (int i = 0; i < n / 2; i++) {
        a += s[i];
      }
      for (int i = 0; i <= n / 2; i++) {
        c += s[i];
      }
      for (int i = n / 2; i < n; i++) {
        b += s[i];
      }
      for (int i = (n / 2) + 1; i < n; i++) {
        d += s[i];
      }
      string x = sum(a, b);
      string y = sum(c, d);
      if (x.length() > y.length()) {
        cout << setprecision(10) << y << endl;
        return 0;
      } else if (x.length() < y.length()) {
        cout << setprecision(10) << x << endl;
        return 0;
      }
      if (x < y) {
        cout << setprecision(10) << x << endl;
      } else {
        cout << setprecision(10) << y << endl;
      }
    }
  } else {
    int ind1 = 0;
    if (s[n / 2] == '0') {
      for (int i = (n / 2) - 1; i >= 0; i--) {
        if (s[i] != '0') {
          ind1 = i;
          break;
        }
      }
      int ind = n / 2;
      while (s[ind + 1] == '0') {
        ind++;
      }
      ind++;
      for (int i = 0; i < max(n / 2, ind); i++) {
        a += s[i];
      }
      for (int i = max(n / 2, ind); i < n; i++) {
        b += s[i];
      }
      for (int i = 0; i < ind1; i++) {
        c += s[i];
      }
      for (int i = ind1; i < n; i++) {
        d += s[i];
      }
      string x = sum(a, b);
      string y = sum(c, d);
      if (x.length() > y.length()) {
        cout << setprecision(10) << y << endl;
        return 0;
      } else if (x.length() < y.length()) {
        cout << setprecision(10) << x << endl;
        return 0;
      }
      if (x < y) {
        cout << setprecision(10) << x << endl;
      } else {
        cout << setprecision(10) << y << endl;
      }
    } else {
      for (int i = 0; i < n; i++) {
        if (i < n / 2) {
          a += s[i];
        } else {
          b += s[i];
        }
      }
      cout << setprecision(10) << sum(a, b) << endl;
    }
  }
}
