#include <bits/stdc++.h>
using namespace std;
string ans;
void f(string &s, int in) {
  string res = "";
  string a = s.substr(0, in);
  string b = s.substr(in);
  int i = (int)a.size() - 1, j = (int)b.size() - 1, carry = 0;
  while (1) {
    if (i >= 0 && j >= 0) {
      int x = (a[i] - 48) + (b[j] - 48) + carry;
      carry = (x >= 10);
      x %= 10;
      char ch = char('0' + x);
      res = ch + res;
      i--, j--;
    } else if (i >= 0) {
      int x = (a[i] - 48) + carry;
      carry = (x >= 10);
      x %= 10;
      char ch = ('0' + x);
      res = ch + res;
      i--;
    } else if (j >= 0) {
      int x = (b[j] - 48) + carry;
      carry = (x >= 10);
      x %= 10;
      char ch = char('0' + x);
      res = ch + res;
      j--;
    } else {
      if (carry) {
        res = '1' + res;
      }
      break;
    }
  }
  if ((int)res.size() < (int)ans.size()) {
    ans = res;
  } else if ((int)res.size() == (int)ans.size()) {
    ans = min(ans, res);
  }
}
int main() {
  int l;
  scanf("%d", &l);
  string s;
  cin >> s;
  ans = string(100010, '9');
  int in1 = l / 2, in2 = l / 2;
  if (l % 2) {
    in2++;
  }
  while (in1 >= 0) {
    if (s[in1] != '0') {
      f(s, in1);
      break;
    }
    in1--;
  }
  while (in2 < l) {
    if (s[in2] != '0') {
      f(s, in2);
      break;
    }
    in2++;
  }
  cout << ans << endl;
}
