#include <bits/stdc++.h>
using namespace std;
string s, ans;
int n;
string operator+(string s, string t) {
  reverse(s.begin(), s.end());
  reverse(t.begin(), t.end());
  string res;
  int g = 0, i;
  for (i = 0; i < s.length() || i < t.length() || g; i++) {
    if (s.length() < i + 1) s.push_back('0');
    if (t.length() < i + 1) t.push_back('0');
    g += s[i] - '0' + t[i] - '0';
    res.push_back(g % 10 + '0');
    g /= 10;
  }
  while (res.size() > 1 && res[res.size() - 1] == 0) res.erase(res.size() - 1);
  reverse(res.begin(), res.end());
  return res;
}
bool cmp(string s, string t) {
  if (s.length() == t.length()) return s < t;
  return s.length() < t.length();
}
bool solve(int x) {
  if (x < 1 || x >= n) return 0;
  if (s[x + 1] == '0') return 0;
  string tmp = s.substr(1, x) + s.substr(x + 1);
  if (cmp(tmp, ans)) ans = tmp;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> s;
  ans = s;
  s = " " + s;
  solve(n / 2);
  solve(n / 2 - 1);
  solve(n / 2 + 1);
  for (register int i = n / 2 - 1; i < n; i++) {
    if (solve(i)) break;
  }
  for (register int i = n / 2 + 1; i >= 1; i--) {
    if (solve(i)) break;
  }
  solve(n / 2 + 2);
  for (register int i = n / 2 - 2; i < n; i++) {
    if (solve(i)) break;
  }
  for (register int i = n / 2 + 2; i >= 1; i--) {
    if (solve(i)) break;
  }
  for (register int i = n / 2 + 2; i < n; i++) {
    if (solve(i)) break;
  }
  for (register int i = n / 2 - 2; i >= 1; i--) {
    if (solve(i)) break;
  }
  cout << ans << endl;
  return 0;
}
