#include <bits/stdc++.h>
using namespace std;
const long long sz = 2e5 + 5;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int l;
string s;
string add(int pos) {
  int carry = 0;
  int sum = 0;
  string temp;
  int i = pos, j = l - 1;
  while (true) {
    sum = s[i] - '0' + s[j] - '0' + carry;
    carry = sum / 10;
    sum %= 10;
    temp.push_back(char(sum + '0'));
    --i, --j;
    if (i == -1 && j == pos) {
      temp.push_back(char(carry + '0'));
      break;
    } else if (i == -1 && j > pos) {
      for (; j > pos; j--) {
        sum = s[j] - '0' + carry;
        carry = sum / 10;
        sum %= 10;
        temp.push_back(char(sum + '0'));
      }
      temp.push_back(char(carry + '0'));
      break;
    } else if (j == pos && i >= 0) {
      for (; i >= 0; i--) {
        sum = s[i] - '0' + carry;
        carry = sum / 10;
        sum %= 10;
        temp.push_back(char(sum + '0'));
      }
      temp.push_back(char(carry + '0'));
      break;
    }
  }
  if (temp[temp.size() - 1] == '0') temp.pop_back();
  reverse(temp.begin(), temp.end());
  return temp;
}
void solve() {
  cin >> l >> s;
  vector<pair<int, int> > v;
  for (int i = 1; i < l; i++) {
    if (s[i] != '0') {
      v.push_back({abs(l / 2 - i), i - 1});
    }
  }
  sort(v.begin(), v.end());
  int x = v.size();
  int len = min(4, x);
  vector<string> vv[100010];
  int M = INT_MAX;
  for (int i = 0; i < len; i++) {
    string t = add(v[i].second);
    int haha = t.size();
    if (haha <= M) {
      M = haha;
      vv[M].push_back(t);
    }
  }
  if (M == INT_MAX) {
    cout << s << endl;
  } else {
    sort(vv[M].begin(), vv[M].end());
    cout << vv[M][0] << endl;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
