#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, m = 100000000000, g = -1, c, t, d = -1;
  cin >> n;
  string s;
  vector<int> p, q;
  cin >> s;
  for (i = 1; i < n; i++) {
    if (s[i] != '0') {
      if (max(i, n - i) < m)
        m = max(i, n - i), d = i;
      else if (m == max(i, n - i)) {
        g = i;
      }
    }
  }
  t = 0;
  for (i = s.size() - 1, j = d - 1; i >= d || j >= 0; i--, j--) {
    if (i >= d && j >= 0) {
      c = (s[i] - '0') + (s[j] - '0') + t;
      p.push_back(c % 10);
      t = c / 10;
    } else {
      if (i >= d) {
        c = (s[i] - '0') + t;
        p.push_back(c % 10);
        t = c / 10;
      } else {
        c = (s[j] - '0') + t;
        p.push_back(c % 10);
        t = c / 10;
      }
    }
  }
  if (t != 0) p.push_back(t);
  if (g != -1) {
    t = 0;
    for (i = s.size() - 1, j = g - 1; i >= g || j >= 0; i--, j--) {
      if (i >= g && j >= 0) {
        c = (s[i] - '0') + (s[j] - '0') + t;
        q.push_back(c % 10);
        t = c / 10;
      } else {
        if (i >= g) {
          c = (s[i] - '0') + t;
          q.push_back(c % 10);
          t = c / 10;
        } else {
          c = (s[j] - '0') + t;
          q.push_back(c % 10);
          t = c / 10;
        }
      }
    }
    if (t != 0) q.push_back(t);
  }
  if (g == -1) {
    for (i = p.size() - 1; i >= 0; i--) cout << p[i];
  } else {
    for (i = q.size() - 1; i >= 0; i--) {
      if (p[i] == q[i])
        cout << p[i];
      else if (q[i] < p[i]) {
        for (j = i; j >= 0; j--) cout << q[j];
        return 0;
      } else {
        for (j = i; j >= 0; j--) cout << p[j];
        return 0;
      }
    }
  }
  return 0;
}
