#include <bits/stdc++.h>
using namespace std;
const long long maxx = 3000005;
const long long mod = 1000000000 + 7;
string ans = "";
void solve(int l, string s, int n) {
  string a = s.substr(0, l);
  string b = s.substr(l, n - l);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  while (a.size() < b.size()) a.push_back('0');
  while (b.size() < a.size()) b.push_back('0');
  int rem = 0;
  for (int i = 0; i < a.size(); i++) {
    int tem = a[i] - '0' + b[i] - '0' + rem;
    rem = tem / 10;
    a[i] = '0' + tem % 10;
  }
  if (rem) a.push_back(char(rem + '0'));
  reverse(a.begin(), a.end());
  if (ans == "") {
    ans = a;
    return;
  }
  if (ans.size() > a.size())
    ans = a;
  else if (ans.size() == ans.size()) {
    int i = 0;
    while (ans[i] == a[i]) i++;
    if (ans[i] > a[i]) ans = a;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int N;
  cin >> N;
  string s;
  cin >> s;
  int mn = 1e9;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i + 1] != '0') {
      mn = min(mn, max(i + 1, N - i - 1));
    }
  }
  for (int i = 0; i < N - 1; i++) {
    if (s[i + 1] != '0' && max(i + 1, N - i - 1) == mn) solve(i + 1, s, N);
  }
  cout << ans;
}
