#include <bits/stdc++.h>
using namespace std;
string s;
vector<char> a, b, num;
void getSum(int br) {
  num.clear();
  a.clear();
  b.clear();
  for (int i = 0; i < br; i++) a.push_back(s[i]);
  for (int i = br; i < s.length(); i++) b.push_back(s[i]);
  int i = a.size() - 1, j = b.size() - 1;
  int carry = 0;
  while (i >= 0 && j >= 0) {
    int x = a[i] - '0';
    int y = b[j] - '0';
    int z = (x + y + carry);
    carry = z / 10;
    num.push_back(z % 10 + '0');
    i--;
    j--;
  }
  while (i >= 0) {
    int x = a[i] - '0';
    int z = x + carry;
    num.push_back(z % 10 + '0');
    carry = z / 10;
    i--;
  }
  while (j >= 0) {
    int x = b[j] - '0';
    j--;
    int z = x + carry;
    num.push_back(z % 10 + '0');
    carry = z / 10;
  }
}
vector<char> temp1, temp2;
bool lesser() {
  if (temp1.size() > temp2.size())
    return false;
  else if (temp1.size() < temp2.size())
    return true;
  else {
    for (int i = temp1.size() - 1; i >= 0; i--) {
      if (temp1[i] > temp2[i])
        return false;
      else if (temp1[i] < temp2[i])
        return true;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, a, b, c, x, y, z;
  cin >> n;
  cin >> s;
  int br = n / 2;
  int ans1;
  while (s[br] == '0' && br < s.length()) br++;
  ans1 = br;
  int ans2;
  br = n / 2;
  while (s[br] == '0' && br >= 0) br--;
  ans2 = br;
  if (ans1 >= s.length()) ans1 = ans2;
  if (ans2 != ans1) {
    getSum(ans1);
    temp1.swap(num);
    getSum(ans2);
    temp2.swap(num);
    if (lesser()) {
      for (int i = temp1.size() - 1; i >= 0; i--) cout << temp1[i];
    } else {
      for (int i = temp2.size() - 1; i >= 0; i--) cout << temp2[i];
    }
  } else {
    getSum(ans1);
    temp1.swap(num);
    if (s[ans1 + 1] == '0')
      temp2 = temp1;
    else {
      getSum(ans1 + 1);
      temp2.swap(num);
    }
    if (lesser()) {
      for (int i = temp1.size() - 1; i >= 0; i--) cout << temp1[i];
    } else {
      for (int i = temp2.size() - 1; i >= 0; i--) cout << temp2[i];
    }
  }
  return 0;
}
