#include <bits/stdc++.h>
using namespace std;
struct node {
  long long i, w, s;
  node() {}
  node(long long _i, long long _s) { s = _s, i = _i; }
  bool operator<(node X) const {
    if (s != X.s) return s < X.s;
    return s < X.s;
  }
};
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long sub(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  return (a - b + 1000000007) % 1000000007;
}
long long prod(long long a, long long b) {
  a %= 1000000007;
  b %= 1000000007;
  return (a * b) % 1000000007;
}
const int MAXN = (1 << 9) + 10;
long long a[300005], dp[300005];
string add(string s1, string s2) {
  if (s1.size() == 0 || s2.size() == 0 || s1[0] == '0' || s2[0] == '0') {
    string s = "";
    for (int i = 0; i < 300005; i++) s += '9';
    return s;
  }
  int sz1 = s1.size(), sz2 = s2.size();
  int car = 0, i = sz1 - 1, j = sz2 - 1;
  string s = "";
  while (i >= 0 && j >= 0) {
    int x = ((s1[i] - '0') + (s2[j] - '0') + car);
    s += ('0' + (x % 10));
    car = x / 10;
    i--, j--;
  }
  while (i >= 0) {
    int x = (s1[i] - '0' + car);
    s += ('0' + (x % 10));
    car = x / 10;
    i--;
  }
  while (j >= 0) {
    int x = (s2[j] - '0' + car);
    s += ('0' + (x % 10));
    car = x / 10;
    j--;
  }
  if (car) s += ('0' + car);
  reverse(s.begin(), s.end());
  while (s.size() && s[0] == '0') s.erase(s.begin());
  return s;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int l;
  cin >> l;
  string s;
  cin >> s;
  int x = l / 2;
  string ans = add(s.substr(0, x), s.substr(x, l - x));
  while (x >= 1 && s[x - 1] == '0') x--;
  string s1 = add(s.substr(0, x - 1), s.substr(x - 1, l - x + 1));
  x = l / 2;
  while (x < l - 1 && s[x + 1] == '0') x++;
  string s2 = add(s.substr(0, x + 1), s.substr(x + 1, l - x - 1));
  if (s1.size() < ans.size())
    ans = s1;
  else if (s1.size() == ans.size())
    ans = min(ans, s1);
  if (s2.size() < ans.size())
    ans = s2;
  else if (s2.size() == ans.size())
    ans = min(ans, s2);
  cout << ans << endl;
}
