#include <bits/stdc++.h>
using namespace std;
unsigned long long nCr(unsigned long long n, unsigned long long r) {
  if (n < r) return 0;
  if (r == 0) return 1;
  return (n * nCr(n - 1, r - 1) / r) % 1000000007;
}
unsigned long long powermod(unsigned long long a, unsigned long long p) {
  a = a % 1000000007;
  unsigned long long res = 1;
  while (p > 0) {
    if (p & 1) res = (res * a) % 1000000007;
    p = p >> 1;
    a = (a * a) % 1000000007;
  }
  return res;
}
unsigned long long invmod(unsigned long long a) {
  return powermod(a, 1000000007 - 2);
}
unsigned long long nCrmod(unsigned long long n, unsigned long long r) {
  if (n < r) return 0;
  if (r == 0 or n == r) return 1;
  unsigned long long fact[n + 1];
  fact[0] = fact[1] = 1;
  for (int i = 2; i <= n; i++)
    fact[i] = (fact[i - 1] * (i % 1000000007)) % 1000000007;
  unsigned long long cnr =
      ((fact[n] * invmod(fact[r]) % 1000000007) * invmod(fact[n - r])) %
      1000000007;
  return cnr;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
bool is_primo(long long n) {
  if (n == 1) return false;
  if (n == 2) return true;
  long long s = sqrt(n);
  for (int i = 2; i <= s + 1; i++)
    if (n % i == 0) return false;
  return true;
}
bool comp(pair<int, int> p1, pair<int, int> p2) { return p1.first < p2.first; }
string add_num_string(string e, string f) {
  string a, b;
  if (e.empty())
    return f;
  else if (f.empty())
    return e;
  else if (e.length() < f.length()) {
    a = f;
    b = e;
  } else {
    a = e;
    b = f;
  }
  int i = b.length() - 1, j = a.length() - 1, c = 0;
  while (i >= 0) {
    int c1 = (a[j] + b[i] + c - 96) / 10;
    a[j] = (a[j] + b[i] - 96 + c) % 10 + 48;
    c = c1;
    i--;
    j--;
  }
  while (j >= 0 and c > 0) {
    int c1 = (a[j] + c - 48) / 10;
    a[j] = (a[j] - 48 + c) % 10 + 48;
    c = c1;
    j--;
  }
  if (c > 0 and j < 0) a = "1" + a;
  return a;
}
bool comp_num_string(string a, string b) {
  if (a.length() != b.length())
    return a.length() > b.length();
  else {
    int i = 0;
    while (a[i] == b[i] and i < a.length()) i++;
    if (i > a.length())
      return false;
    else {
      return a[i] > b[i];
    }
  }
}
void solve() {
  int l;
  cin >> l;
  string num;
  cin >> num;
  if (l % 2 == 0) {
    auto i = num.begin() + l / 2, j = i;
    while (*i == '0') i--;
    while (*j == '0') j++;
    string n1(num.begin(), i), n2(i, num.end());
    string a = add_num_string(n1, n2);
    string m1(num.begin(), j), m2(j, num.end());
    string b = add_num_string(m1, m2);
    if (comp_num_string(a, b))
      cout << b << "\n";
    else
      cout << a << "\n";
  } else {
    auto i = num.begin() + l / 2, j = i + 1;
    while (*i == '0') i--;
    while (*j == '0') j++;
    string n1(num.begin(), i), n2(i, num.end());
    string a = add_num_string(n1, n2);
    string m1(num.begin(), j), m2(j, num.end());
    string b = add_num_string(m1, m2);
    if (comp_num_string(a, b))
      cout << b << "\n";
    else
      cout << a << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
}
