#include <bits/stdc++.h>
using namespace std;
string sum_str(string a, string b) {
  int i;
  int diff = a.size() - b.size();
  string zeros = "";
  for (i = 0; i < abs(diff); i++) zeros += "0";
  if (diff > 0) {
    b = zeros + b;
  } else if (diff < 0) {
    a = zeros + a;
  }
  int c = 0;
  string ret = "";
  for (i = a.size() - 1; i >= 0; i--) {
    if (a[i] + b[i] - 2 * '0' + c > 9) {
      ret = char(a[i] + b[i] - '0' - 10 + c) + ret;
      c = 1;
    } else {
      ret = char(a[i] + b[i] - '0' + c) + ret;
      c = 0;
    }
  }
  if (c == 1) ret = "1" + ret;
  return ret;
}
string min_str(string a, string b) {
  string A = a, B = b;
  int i;
  int diff = a.size() - b.size();
  string zeros = "";
  for (i = 0; i < abs(diff); i++) zeros += "0";
  if (diff > 0) {
    b = zeros + b;
  } else if (diff < 0) {
    a = zeros + a;
  }
  if (a < b)
    return A;
  else
    return B;
}
int main() {
  long long l, i, j, k, n;
  string str;
  cin >> l >> str;
  n = str.size();
  string a = "", b = "", v1, v2;
  if (n % 2 == 0) {
    i = j = n / 2;
  } else {
    i = n / 2;
    j = n / 2 + 1;
  }
  while (str[i] == '0') i--;
  while (str[j] == '0') j++;
  a = "", b = "";
  for (k = 0; k < i; k++) a += str[k];
  for (k = i; k < n; k++) b += str[k];
  v1 = sum_str(a, b);
  a = "", b = "";
  for (k = 0; k < j; k++) a += str[k];
  for (k = j; k < n; k++) b += str[k];
  v2 = sum_str(a, b);
  cout << min_str(v1, v2);
}
