#include <bits/stdc++.h>
using namespace std;
int n, x, y, t;
deque<int> a, b, c[3];
string s;
bool sosanh(deque<int> a, deque<int> b) {
  if (a.size() != b.size()) return a.size() < b.size();
  deque<int> a2 = a, b2 = b;
  while (a2.size()) {
    if (a2.front() != b2.front()) return a2.front() < b2.front();
    a2.pop_front();
    b2.pop_front();
  }
  return 1;
}
deque<int> cong(deque<int> a, deque<int> b) {
  int nho = 0, t;
  deque<int> res;
  while (b.size() < a.size()) b.push_front(0);
  while (a.size() < b.size()) a.push_front(0);
  while (a.size() > 0) {
    t = nho + a.back() + b.back();
    nho = t / 10;
    res.push_front(t % 10);
    a.pop_back();
    b.pop_back();
  }
  while (res.front() == 0) res.pop_front();
  return res;
}
void tinh(int x, int cl) {
  a.clear();
  b.clear();
  for (int i = 0; i < x; i++) a.push_back(s[i] - 48);
  for (int i = x; i < n; i++) b.push_back(s[i] - 48);
  c[cl] = cong(a, b);
}
int main() {
  cin >> n;
  cin >> s;
  x = n / 2;
  y = x + 1;
  while (s[x] == '0') --x;
  while (s[y] == '0') ++y;
  tinh(x, 1);
  tinh(y, 2);
  if (sosanh(c[1], c[2]))
    t = 1;
  else
    t = 2;
  while (c[t].size()) {
    cout << c[t].front();
    c[t].pop_front();
  }
  return 0;
}
