#include <bits/stdc++.h>
using namespace std;
int n;
bool ok1 = 0, ok2 = 0;
string tmp1, tmp2, tmp3, tmp4;
string str, mini1, mini2, ans;
void check(bool b) {
  for (int i = 0; i < n; i++) {
    if (i >= n / 2 + b && str[i] != '0') ok1 = 1;
    if (ok1)
      tmp2 += str[i];
    else
      tmp1 += str[i];
    if (ok2)
      tmp3 += str[n - i - 1];
    else
      tmp4 += str[n - i - 1];
    if (n - i - 1 < n / 2 + b && str[n - i - 1] != '0') ok2 = 1;
  }
  reverse(tmp3.begin(), tmp3.end());
  reverse(tmp4.begin(), tmp4.end());
}
string calc(string fi, string se) {
  int cary = 0, i = fi.size() - 1, y = se.size() - 1;
  string tmp = "";
  for (; i >= 0 || y >= 0; i--, y--) {
    int sum = 0;
    if (y >= 0) sum += (se[y] - '0');
    if (i >= 0) sum += (fi[i] - '0');
    sum += cary;
    tmp += (sum % 10) + '0';
    sum >= 10 ? cary = 1 : cary = 0;
  }
  if (cary) tmp += cary + '0';
  reverse(tmp.begin(), tmp.end());
  return tmp;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  cin >> n >> str;
  if (n % 2 == 0 && str[n / 2] != '0') {
    for (int i = 0; i < n; i++)
      if (i < n / 2)
        tmp1 += str[i];
      else
        tmp2 += str[i];
    ans = calc(tmp1, tmp2);
    cout << ans << endl, exit(0);
  } else if (n % 2 == 0 && str[n / 2] != '0')
    check(0);
  else
    check(1);
  if (tmp1.size() && tmp2.size()) mini1 = calc(tmp1, tmp2);
  if (tmp3.size() && tmp4.size()) mini2 = calc(tmp3, tmp4);
  if (mini1.size() == 0)
    cout << mini2;
  else if (mini2.size() == 0)
    cout << mini1;
  else if (mini1.size() < mini2.size())
    cout << mini1;
  else if (mini1.size() > mini2.size())
    cout << mini2;
  else if (mini1 > mini2)
    cout << mini2;
  else if (mini1 < mini2)
    cout << mini1;
  return 0;
}
