#include <bits/stdc++.h>
using namespace std;
int l;
string a, b;
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
string sum() {
  long long len1 = a.length();
  long long len2 = b.length();
  long long len = max(len1, len2) + 10;
  string ans(len, '0');
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  for (int i = 0; i < len1; i++) ans[i] = a[i];
  int tmp = 0;
  for (int i = 0; i < len; i++) {
    if (len1 >= len2) {
      if (i < len2) {
        tmp += (ans[i] - '0') + (b[i] - '0');
      } else {
        tmp += (ans[i] - '0');
      }
      ans[i] = tmp % 10 + '0';
      tmp /= 10;
    } else if (len1 < len2) {
      if (i < len1) {
        tmp += (ans[i] - '0') + (b[i] - '0');
      } else if (i < len2) {
        tmp += (b[i] - '0');
      }
      ans[i] = tmp % 10 + '0';
      tmp /= 10;
    }
  }
  reverse(ans.begin(), ans.end());
  return ans.substr(ans.find_first_not_of('0'));
}
int main() {
  l = read();
  string s;
  cin >> s;
  int sa = (l >> 1) + 1, sb = l >> 1;
  while (s[sa] == '0') sa++;
  a = s.substr(0, sa), b = s.substr(sa, (l - sa));
  string a1 = sum();
  while (s[sb] == '0') sb--;
  a = s.substr(0, sb), b = s.substr(sb, (l - sb));
  string a2 = sum();
  if (a1.length() < a2.length())
    cout << a1;
  else if (a1.length() > a2.length())
    cout << a2;
  else
    cout << min(a1, a2);
  return 0;
}
