#include <bits/stdc++.h>
using namespace std;
vector<int> sum(vector<int> a, vector<int> b) {
  int carry = 0;
  for (int i = 0; i < max(int(a.size()), int(b.size())) || carry; ++i) {
    if (i == int(a.size())) a.push_back(0);
    a[i] += carry + (i < int(b.size()) ? b[i] : 0);
    carry = a[i] >= 10;
    if (carry) a[i] -= 10;
  }
  return a;
}
bool islower(vector<int> a, vector<int> b) {
  if (int(a.size()) > b.size()) {
    return false;
  }
  if (int(a.size()) < b.size()) {
    return true;
  }
  int n = int(a.size());
  for (int i = n - 1; i >= 0; --i) {
    if (a[i] > b[i]) {
      return false;
    }
    if (a[i] < b[i]) {
      return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    a[i] = int(c) - int('0');
  }
  bool f = false;
  int x = -1;
  for (int i = n / 2; i < n; i++) {
    if (a[i] > 0) {
      x = i;
      break;
    }
  }
  vector<int> b, c;
  if (x > -1) {
    for (int i = 0; i < n; i++) {
      if (i < x)
        b.push_back(a[i]);
      else
        c.push_back(a[i]);
    }
    reverse(b.begin(), b.end());
    reverse(c.begin(), c.end());
    vector<int> gg;
    gg = sum(b, c);
    if (!f || islower(gg, ans)) {
      f = true;
      ans = gg;
    }
  }
  x = -1;
  b.clear();
  c.clear();
  for (int i = (n + 1) / 2; i > 0; i--) {
    if (a[i] > 0) {
      x = i;
      break;
    }
  }
  if (x > -1) {
    for (int i = 0; i < n; i++) {
      if (i < x)
        b.push_back(a[i]);
      else
        c.push_back(a[i]);
    }
    reverse(b.begin(), b.end());
    reverse(c.begin(), c.end());
    vector<int> gg;
    gg = sum(b, c);
    if (!f || islower(gg, ans)) {
      f = true;
      ans = gg;
    }
  }
  reverse(ans.begin(), ans.end());
  for (int i : ans) {
    cout << i;
  }
  return 0;
}
