#include <bits/stdc++.h>
using namespace std;
string add(string a, string b) {
  string res = "";
  while (a.size() < b.size()) a = "0" + a, a[0] -= '0';
  while (b.size() < a.size()) b = "0" + b, b[0] -= '0';
  while (res.size() < a.size()) res += "0";
  int s = b.size();
  char carry = '0';
  carry -= '0';
  for (int i = s - 1; i >= 0; i--) {
    res[i] = a[i] + b[i] + carry;
    carry = res[i] / 10;
    res[i] = res[i] % 10;
  }
  reverse(res.begin(), res.end());
  res += "0", res[res.size() - 1] = carry;
  reverse(res.begin(), res.end());
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int l, mini = INT_MAX;
  string n;
  vector<int> indx;
  cin >> l >> n;
  for (int i = 0; i < l; i++) {
    n[i] -= '0';
    if (n[i] != 0) {
      int x = max(i, l - i);
      if (x == mini) indx.push_back(i);
      if (x < mini) {
        indx.clear();
        mini = x;
        indx.push_back(i);
      }
    }
  }
  string mn = add(n.substr(0, indx[0]), n.substr(indx[0]));
  int m = indx.size();
  for (int i = 1; i < m; i++)
    mn = min(mn, add(n.substr(0, indx[i]), n.substr(indx[i])));
  int s = mn.size();
  if (mn[0] != 0) printf("%d", mn[0]);
  for (int i = 1; i < s; i++) printf("%d", mn[i]);
  return 0;
}
