#include <bits/stdc++.h>
using namespace std;
const long long M = 998244353;
const long long N = 1e3 + 10;
const long long IM = 1e18 + 37;
inline void PP(long long n) { cout << n << " "; }
void PV(vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << "\n";
}
void PVV(vector<pair<long long, long long> > v) {
  for (long long i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << "\n";
}
void PA(long long v[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cout << v[i] << ' ';
  cout << "\n";
}
void IN(long long a[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cin >> a[i];
}
inline void op() {}
string findSum(string str1, string str2) {
  if (str1.length() > str2.length()) swap(str1, str2);
  string str = "";
  long long n1 = str1.length(), n2 = str2.length();
  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  long long carry = 0;
  for (long long i = 0; i < n1; i++) {
    long long sum = ((str1[i] - '0') + (str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (long long i = n1; i < n2; i++) {
    long long 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;
}
bool com(string a, string b) {
  if (a.size() == b.size())
    return a <= b;
  else
    return a.size() <= b.size();
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  op();
  long long l;
  cin >> l;
  string s;
  cin >> s;
  long long u = l / 2;
  while (u < l && s[u] == '0') u++;
  std::vector<string> v;
  if (u != l) {
    string a = s.substr(0, l - (l - u));
    string b = s.substr(u);
    v.push_back(findSum(a, b));
  }
  u = l - l / 2;
  while (u < l && s[u] == '0') u++;
  if (u != l) {
    string a = s.substr(0, l - (l - u));
    string b = s.substr(u);
    v.push_back(findSum(a, b));
  }
  u = l / 2;
  while (u >= 0 && s[u] == '0') u--;
  if (u >= 0) {
    string a = s.substr(0, l - (l - u));
    string b = s.substr(u);
    v.push_back(findSum(a, b));
  }
  u = l - l / 2;
  while (u >= 0 && s[u] == '0') u--;
  if (u >= 0) {
    string a = s.substr(0, l - (l - u));
    string b = s.substr(u);
    v.push_back(findSum(a, b));
  }
  sort(v.begin(), v.end(), com);
  cout << (v[0]) << "\n";
  return 0;
}
