#include <bits/stdc++.h>
using namespace std;
typedef pair<int, pair<int, int> > pnii;
void init() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cout.tie(0);
}
long long second(long long x) {
  long long s = 0;
  while (x) {
    s += x % 10;
    x /= 10;
  }
  return s;
}
long long powe(long long a, long long n) {
  if (n == 1) return a;
  return a * powe(a, n - 1);
}
long long com(int n, int m) {
  long long z = 1;
  for (int i = 0; i < m; i++) {
    z = z * (n - i) / (i + 1);
  }
  return z;
}
int fix(int a, int k) { return (a % k + k) % k; }
int* LIS_Lengths(vector<int> a) {
  int* lis = new int[a.size()];
  int b[a.size()];
  int maxLength = 1, lowerBound;
  lis[0] = 1, b[0] = a[0];
  for (size_t i = 1; i < a.size(); i++) {
    lowerBound = lower_bound(b, b + maxLength, a[i]) - b;
    lis[i] = lowerBound + 1;
    if (lowerBound == maxLength)
      b[maxLength++] = a[i];
    else
      b[lowerBound] = a[i];
  }
  return lis;
}
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int dr[] = {0, 0, 0, 1, 1, 1, -1, -1, -1};
int dc[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
string findSum(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() {
  init();
  int n;
  cin >> n;
  string x;
  cin >> x;
  string A = " ", B = " ";
  if (n % 2 == 0 && x[n / 2] != '0') {
    A = findSum(x.substr(0, n / 2), x.substr(n / 2));
    B = A;
  } else if (n % 2 == 1 && (x[n / 2] != '0' && x[n / 2 + 1] != '0')) {
    A = findSum(x.substr(0, n / 2), x.substr(n / 2));
    B = findSum(x.substr(0, n / 2 + 1), x.substr(n / 2 + 1));
  } else if (n % 2 == 1) {
    for (int i = n / 2; i < n; i++) {
      if (x[i] != '0') {
        A = findSum(x.substr(0, i), x.substr(i));
        break;
      }
    }
    for (int i = n / 2; i >= 0; i--) {
      if (x[i] != '0') {
        B = findSum(x.substr(0, i), x.substr(i));
        break;
      }
    }
  } else {
    for (int i = n / 2 - 1; i < n; i++) {
      if (x[i] != '0') {
        A = findSum(x.substr(0, i), x.substr(i));
        break;
      }
    }
    for (int i = n / 2 - 1; i >= 0; i--) {
      if (x[i] != '0') {
        B = findSum(x.substr(0, i), x.substr(i));
        break;
      }
    }
  }
  if (B == " ")
    return cout << A, 0;
  else if (A == " ")
    return cout << B, 0;
  else if (A.size() != B.size()) {
    if (A.size() < B.size())
      cout << A;
    else
      cout << B;
  } else {
    for (int i = 0; i < A.size(); i++) {
      if (A[i] < B[i])
        return cout << A, 0;
      else if (B[i] < A[i])
        return cout << B, 0;
    }
    cout << A;
  }
}
