#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using ii = pair<int, int>;
using ll = pair<lint, lint>;
using ti = tuple<int, int, int>;
using il = pair<int, lint>;
namespace T {
const int MAX = 1e5 + 5;
const int INF = 1e9 + 7;
const int N = 1e6 + 5;
int max_t[4 * MAX];
int min_t[4 * MAX];
void init() {
  for (int i = 0; i < 4 * MAX; i++) {
    max_t[i] = min_t[i] = 0;
  }
}
void max_up(int n, int s, int e, int p, int v) {
  if (p < s || p > e) return;
  if (s == e)
    max_t[n] = v;
  else {
    max_up(2 * n, s, (s + e) / 2, p, v);
    max_up(2 * n + 1, (s + e) / 2 + 1, e, p, v);
    max_t[n] = max(max_t[2 * n], max_t[2 * n + 1]);
  }
}
void min_up(int n, int s, int e, int p, int v) {
  if (p < s || p > e) return;
  if (s == e)
    min_t[n] = v;
  else {
    min_up(2 * n, s, (s + e) / 2, p, v);
    min_up(2 * n + 1, (s + e) / 2 + 1, e, p, v);
    min_t[n] = min(min_t[2 * n], min_t[2 * n + 1]);
  }
}
int max_v(int n, int s, int e, int l, int r) {
  if (r < s || l > e) return 0;
  if (l <= s && e <= r) return max_t[n];
  int m = (s + e) / 2;
  return max(max_v(2 * n, s, m, l, r), max_v(2 * n + 1, m + 1, e, l, r));
}
int min_v(int n, int s, int e, int l, int r) {
  if (r < s || l > e) return INF;
  if (l <= s && e <= r) return min_t[n];
  int m = (s + e) / 2;
  return min(min_v(2 * n, s, m, l, r), min_v(2 * n + 1, m + 1, e, l, r));
}
class fenwick {
 public:
  lint tree[N] = {
      0,
  };
  void update(int p, lint v) {
    while (p < N) {
      tree[p] += v;
      p += p & -p;
    }
  }
  lint sum(int p) {
    if (p == 0) {
      return 0LL;
    }
    lint ret = 0;
    while (p) {
      ret += tree[p];
      p -= p & -p;
    }
    return ret;
  }
  lint sum(int x, int y) { return sum(y) - sum(x - 1); }
};
}  // namespace T
namespace P {
const int N = 2 * 1e6 + 5;
using lint = long long;
bool v[N];
void make() {
  fill(v, v + N, true);
  for (int i = 2; i < N; i++) {
    if (v[i]) {
      for (lint j = (lint)i * i; j < N; j += i) {
        v[j] = false;
      }
    }
  }
}
}  // namespace P
namespace U {
int min3(int a, int b, int c) { return min(min(a, b), c); }
int min4(int a, int b, int c, int d) { return min(min(a, b), min(c, d)); }
int max3(int a, int b, int c) { return max(max(a, b), c); }
int max4(int a, int b, int c, int d) { return max(max(a, b), max(c, d)); }
bool get(char c) {
  return (c == 'a') || (c == 'e') || (c == 'i') || (c == 'o') || (c == 'u');
}
int gcd(int a, int b) {
  if (a < b) {
    swap(a, b);
  }
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
}  // namespace U
namespace C {
int get(const vector<int>& v, int key) {
  int l = 0;
  int r = (int)(v.size()) - 1;
  while (l <= r) {
    int m = (l + r) / 2;
    if (v[m] == key) {
      return m;
    } else if (v[m] < key) {
      l = m + 1;
    } else {
      r = m - 1;
    }
  }
}
vector<int> compress(const vector<int>& v) {
  vector<int> val = v;
  sort(val.begin(), val.end());
  val.erase(unique(val.begin(), val.end()), val.end());
  vector<int> re = v;
  for (int& x : re) {
    x = get(val, x) + 1;
  }
  return re;
}
}  // namespace C
lint x, y, z;
void input() {}
int n;
const int N = 1e5 + 5;
char s[N];
int l;
string get(int x) {
  vector<char> v1;
  vector<char> v2;
  vector<char> v3;
  for (int i = 0; i < x; i++) {
    v1.push_back(s[i]);
  }
  for (int i = x; i < l; i++) {
    v2.push_back(s[i]);
  }
  reverse(v1.begin(), v1.end());
  reverse(v2.begin(), v2.end());
  v3.push_back('0');
  for (int i = 0; i < max(v1.size(), v2.size()); i++) {
    int x = 0;
    int y = 0;
    if (i < v1.size()) {
      x = v1[i] - '0';
    }
    if (i < v2.size()) {
      y = v2[i] - '0';
    }
    int z = v3[i] - '0';
    int w = x + y + z;
    v3[i] = w % 10 + '0';
    v3.push_back(w / 10 + '0');
  }
  while (v3.back() == '0') {
    v3.pop_back();
  }
  string re;
  reverse(v3.begin(), v3.end());
  for (char c : v3) {
    re.push_back(c);
  }
  return re;
}
void go() {
  scanf("%d", &l);
  scanf("%s", s);
  l = strlen(s);
  int st = l / 2;
  string s1, s2;
  for (int i = 0; i < 1e6; i++) {
    s1.push_back('9');
    s2.push_back('9');
  }
  for (int i = st; i > 0; i--) {
    if (s[i] != '0') {
      s1 = get(i);
      break;
    }
  }
  for (int i = st + 1; i < l; i++) {
    if (s[i] != '0') {
      s2 = get(i);
      break;
    }
  }
  if (s1.length() > s2.length()) {
    cout << s2;
  } else if (s1.length() < s2.length()) {
    cout << s1;
  } else {
    if (s1 > s2) {
      cout << s2;
    } else {
      cout << s1;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  input();
  go();
}
