#include <bits/stdc++.h>
using namespace std;
vector<int> v1, v2, ans1, ans2;
bool cmp() {
  if (ans1.size() < ans2.size()) return true;
  if (ans1.size() > ans2.size()) return false;
  for (int i = ans1.size() - 1; i >= 0; i--) {
    if (ans1[i] < ans2[i]) return true;
    if (ans1[i] > ans2[i]) return false;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int idx = n / 2, idy;
  if (n % 2 == 0) {
    idy = idx;
    while (s[idy] == '0' && idy < n) idy++;
    while (s[idx] == '0' && idx > 0) idx--;
  } else {
    idy = idx + 1;
    while (s[idy] == '0' && idy < n) idy++;
    while (s[idx] == '0' && idx > 0) idx--;
  }
  v1.clear();
  v2.clear();
  for (int i = idx - 1; i >= 0; i--) v1.push_back(s[i] - '0');
  for (int i = n - 1; i >= idx; i--) v2.push_back(s[i] - '0');
  for (int i = 0; i < max(v1.size(), v2.size()); i++) {
    int tot = 0;
    if (i < v1.size()) tot += v1[i];
    if (i < v2.size()) tot += v2[i];
    ans1.push_back(tot);
  }
  v1.clear();
  v2.clear();
  for (int i = idy - 1; i >= 0; i--) v1.push_back(s[i] - '0');
  for (int i = n - 1; i >= idy; i--) v2.push_back(s[i] - '0');
  for (int i = 0; i < max(v1.size(), v2.size()); i++) {
    int tot = 0;
    if (i < v1.size()) tot += v1[i];
    if (i < v2.size()) tot += v2[i];
    ans2.push_back(tot);
  }
  for (int i = 0; i < ans1.size(); i++) {
    if (i != ans1.size() - 1 && ans1[i] >= 10) {
      ans1[i + 1] += ans1[i] / 10;
      ans1[i] %= 10;
    }
    if (i == ans1.size() - 1 && ans1[i] >= 10) {
      ans1.push_back(ans1[i] / 10);
      ans1[i] %= 10;
    }
  }
  for (int i = 0; i < ans2.size(); i++) {
    if (i != ans2.size() - 1 && ans2[i] >= 10) {
      ans2[i + 1] += ans2[i] / 10;
      ans2[i] %= 10;
    }
    if (i == ans2.size() - 1 && ans2[i] >= 10) {
      ans2.push_back(ans2[i] / 10);
      ans2[i] %= 10;
    }
  }
  if (cmp())
    for (int i = ans1.size() - 1; i >= 0; i--) cout << ans1[i];
  else
    for (int i = ans2.size() - 1; i >= 0; i--) cout << ans2[i];
  return 0;
}
