#include <bits/stdc++.h>
using namespace std;
int n;
string A;
vector<string> W;
int p;
void czyt() {
  cin >> n;
  cin >> A;
}
char znak(int d) {
  string z = "0123456789";
  return (z[d]);
}
void suma(int sr) {
  int p1, p2, d;
  bool carry = false;
  string s = "";
  p1 = sr - 1;
  p2 = n - 1;
  while (p1 >= 0 && p2 >= sr) {
    d = (A[p1] - '0') + (A[p2] - '0');
    if (carry) d++;
    carry = d > 9;
    d = d % 10;
    s = s + znak(d);
    p1--;
    p2--;
  }
  while (p1 >= 0) {
    d = (A[p1] - '0');
    if (carry) d++;
    carry = d > 9;
    d = d % 10;
    s = s + znak(d);
    p1--;
  }
  while (p2 >= sr) {
    d = (A[p2] - '0');
    if (carry) d++;
    carry = d > 9;
    d = d % 10;
    s = s + znak(d);
    p2--;
  }
  if (carry) s = s + znak(1);
  W.push_back(s);
}
void rozw() {
  int lewa, prawa;
  if (n % 2 == 0)
    if (A[n / 2] != '0') suma(n / 2);
  if (n % 2 == 1) {
    if (A[n / 2] != '0') suma(n / 2);
    if (A[n / 2 + 1] != '0') suma(n / 2 + 1);
  }
  lewa = n / 2;
  while (A[lewa] == '0') lewa--;
  suma(lewa);
  prawa = n / 2;
  while (A[prawa] == '0') prawa++;
  suma(prawa);
}
bool mniejszy(string a, string b) {
  if (a.size() < b.size()) return true;
  if (a.size() > b.size()) return false;
  if (a == b) return false;
  int r = a.size();
  while (r >= 0 && a[r] == b[r]) r--;
  return (a[r] < b[r]);
}
int minimalny() {
  int m = 0;
  for (int i = 1; i < W.size(); i++)
    if (mniejszy(W[i], W[m])) m = i;
  return (m);
}
int main() {
  czyt();
  rozw();
  string s = W[minimalny()];
  for (int i = s.size() - 1; i >= 0; i--) cout << s[i];
  cout << "\n";
}
