#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  string s;
  cin >> n >> s;
  int b, c;
  stack<int> st1, st2;
  if (n % 2)
    b = n / 2 + 1, c = n / 2;
  else
    b = n / 2, c = n / 2 - 1;
  for (; b < n and s[b] == '0'; b++)
    ;
  for (; c >= 0 and s[c] == '0'; c--)
    ;
  if (b < n) {
    int car = 0, x = 0;
    for (int i = b - 1, j = n - 1; i >= 0 or j >= b; i--, j--) {
      x = car + (s[i] - '0');
      if (j >= b) x += (s[j] - '0');
      car = x / 10;
      st1.push(x % 10);
    }
    if (car > 0) st1.push(car);
  }
  if (c > 0) {
    int car = 0;
    for (int i = n - 1, j = c - 1; i >= c or j >= 0; i--, j--) {
      int x = car + (s[i] - '0');
      if (j >= 0) x += (s[j] - '0');
      car = x / 10;
      st2.push(x % 10);
    }
    if (car > 0) st2.push(car);
  }
  bool fl = true;
  if (b < n and c > 0) {
    if (st1.size() > st2.size())
      fl = false;
    else if (st1.size() == st2.size()) {
      int a1, a2;
      while (st1.size()) {
        a1 = st1.top();
        a2 = st2.top();
        st1.pop();
        st2.pop();
        if (a1 == a2)
          cout << a1;
        else if (a1 > a2) {
          cout << a2;
          while (st2.size()) {
            cout << st2.top();
            st2.pop();
          }
          cout << endl;
          return 0;
        } else {
          cout << a1;
          while (st1.size()) {
            cout << st1.top();
            st1.pop();
          }
          cout << endl;
          return 0;
        }
      }
    }
  }
  if (b < n and fl) {
    while (st1.size()) {
      cout << st1.top();
      st1.pop();
    }
    cout << endl;
    return 0;
  }
  while (st2.size()) {
    cout << st2.top();
    st2.pop();
  }
  cout << endl;
  return 0;
}
