#include <bits/stdc++.h>
using namespace std;
string sum(string s1, string s2) {
  int i, j, s11, s22, car = 0, num = 0;
  s11 = s1.size();
  s22 = s2.size();
  string t;
  i = 0;
  j = 0;
  while (i < s11 || j < s22) {
    if (i < s11 && j < s22) {
      num = s1[s11 - 1 - i] + s2[s22 - 1 - j] - 96 + car;
      if (num > 9) {
        car = num / 10;
        num = num % 10;
      } else {
        car = 0;
      }
      t.push_back(num + 48);
      i++;
      j++;
    } else if (i < s11) {
      num = s1[s11 - 1 - i] - 48 + car;
      if (num > 9) {
        car = num / 10;
        num = num % 10;
      } else {
        car = 0;
      }
      t.push_back(num + 48);
      i++;
    } else if (j < s22) {
      num = s2[s22 - 1 - j] - 48 + car;
      if (num > 9) {
        car = num / 10;
        num = num % 10;
      } else {
        car = 0;
      }
      t.push_back(num + 48);
      j++;
    }
  }
  if (car > 0) {
    t.push_back(car + 48);
  }
  reverse(t.begin(), t.end());
  return t;
}
int main() {
  int l, i, j, f1 = 0, f2 = 0;
  cin >> l;
  string s, t[l], a, b, s1, s2;
  cin >> s;
  for (i = l / 2 - 1; i > -2; i--) {
    if (s[i + 1] != '0') {
      s1 = s.substr(0, i + 1);
      s2 = s.substr(i + 1);
      a = sum(s1, s2);
      f1 = 1;
      break;
    }
  }
  for (i = l / 2 + 1; i < l; i++) {
    if (s[i] != '0') {
      s1 = s.substr(0, i);
      s2 = s.substr(i);
      b = sum(s1, s2);
      f2 = 1;
      break;
    }
  }
  if (f1 && f2) {
    if ((a < b && a.size() == b.size()) || a.size() < b.size()) {
      cout << a;
    } else {
      cout << b;
    }
  } else if (f1) {
    cout << a;
  } else if (f2) {
    cout << b;
  }
}
