#include <bits/stdc++.h>
using namespace std;
int main() {
  int l;
  string s;
  cin >> l >> s;
  if (l % 2 == 0) {
    if (s[l / 2] == '0') {
      int idx = l / 2;
      while (idx < l - 1 && s[idx] == '0') idx++;
      stack<char> bil1, bil2;
      string ans1, ans2;
      if (s[idx] != '0') {
        for (int i = 0; i < idx; i++) {
          bil1.push(s[i]);
        }
        for (int i = idx; i < l; i++) {
          bil2.push(s[i]);
        }
        int tmp = 0;
        while (!bil1.empty() && !bil2.empty()) {
          int x = (int)bil1.top() - '0', y = (int)bil2.top() - '0';
          bil1.pop();
          bil2.pop();
          ans1.push_back((char)((x + y + tmp) % 10) + '0');
          tmp = (x + y + tmp) / 10;
        }
        while (!bil1.empty()) {
          int x = (int)bil1.top() - '0';
          bil1.pop();
          ans1.push_back((char)((x + tmp) % 10) + '0');
          tmp = (x + tmp) / 10;
        }
        while (!bil2.empty()) {
          int x = (int)bil2.top() - '0';
          bil2.pop();
          ans1.push_back((char)((x + tmp) % 10) + '0');
          tmp = (x + tmp) / 10;
        }
        if (tmp > 0) ans1.push_back((char)tmp + '0');
      }
      idx = l / 2;
      while (idx > 1 && s[idx] == '0') idx--;
      if (s[idx] == '0')
        cout << ans1 << "\n";
      else {
        for (int i = 0; i < idx; i++) {
          bil1.push(s[i]);
        }
        for (int i = idx; i < l; i++) {
          bil2.push(s[i]);
        }
        int tmp = 0;
        while (!bil1.empty() && !bil2.empty()) {
          int x = (int)bil1.top() - '0', y = (int)bil2.top() - '0';
          bil1.pop();
          bil2.pop();
          ans2.push_back((char)((x + y + tmp) % 10) + '0');
          tmp = (x + y + tmp) / 10;
        }
        while (!bil1.empty()) {
          int x = (int)bil1.top() - '0';
          bil1.pop();
          ans2.push_back((char)((x + tmp) % 10) + '0');
          tmp = (x + tmp) / 10;
        }
        while (!bil2.empty()) {
          int x = (int)bil2.top() - '0';
          bil2.pop();
          ans2.push_back((char)((x + tmp) % 10) + '0');
          tmp = (x + tmp) / 10;
        }
        if (tmp > 0) ans2.push_back((char)tmp + '0');
        reverse(ans1.begin(), ans1.end());
        reverse(ans2.begin(), ans2.end());
        if (ans1 == "")
          cout << ans2 << "\n";
        else if (ans1.length() < ans2.length())
          cout << ans1 << "\n";
        else if (ans1.length() > ans2.length())
          cout << ans2 << "\n";
        else {
          if (ans1 < ans2)
            cout << ans1 << "\n";
          else
            cout << ans2 << "\n";
        }
      }
    } else {
      stack<char> bil1, bil2, ans;
      for (int i = 0; i < l / 2; i++) {
        bil1.push(s[i]);
      }
      for (int i = l / 2; i < l; i++) {
        bil2.push(s[i]);
      }
      int tmp = 0;
      while (!bil1.empty() && !bil2.empty()) {
        int x = (int)bil1.top() - '0', y = (int)bil2.top() - '0';
        bil1.pop();
        bil2.pop();
        ans.push((char)((x + y + tmp) % 10) + '0');
        tmp = (x + y + tmp) / 10;
      }
      while (!bil1.empty()) {
        int x = (int)bil1.top() - '0';
        bil1.pop();
        ans.push((char)((x + tmp) % 10) + '0');
        tmp = (x + tmp) / 10;
      }
      while (!bil2.empty()) {
        int x = (int)bil2.top() - '0';
        bil2.pop();
        ans.push((char)((x + tmp) % 10) + '0');
        tmp = (x + tmp) / 10;
      }
      if (tmp > 0) ans.push((char)tmp + '0');
      while (!ans.empty()) {
        cout << ans.top();
        ans.pop();
      }
      cout << "\n";
    }
  } else {
    string ans1, ans2;
    int idx = l / 2;
    while (idx > 1 && s[idx] == '0') idx--;
    stack<char> bil1, bil2;
    if (s[idx] != '0') {
      for (int i = 0; i < idx; i++) {
        bil1.push(s[i]);
      }
      for (int i = idx; i < l; i++) {
        bil2.push(s[i]);
      }
      int tmp = 0;
      while (!bil1.empty() && !bil2.empty()) {
        int x = (int)bil1.top() - '0', y = (int)bil2.top() - '0';
        bil1.pop();
        bil2.pop();
        ans1.push_back((char)((x + y + tmp) % 10) + '0');
        tmp = (x + y + tmp) / 10;
      }
      while (!bil1.empty()) {
        int x = (int)bil1.top() - '0';
        bil1.pop();
        ans1.push_back((char)((x + tmp) % 10) + '0');
        tmp = (x + tmp) / 10;
      }
      while (!bil2.empty()) {
        int x = (int)bil2.top() - '0';
        bil2.pop();
        ans1.push_back((char)((x + tmp) % 10) + '0');
        tmp = (x + tmp) / 10;
      }
      if (tmp > 0) ans1.push_back((char)tmp + '0');
    }
    idx = l / 2 + 1;
    while (idx < l - 1 && s[idx] == '0') idx++;
    if (s[idx] != '0') {
      for (int i = 0; i < idx; i++) {
        bil1.push(s[i]);
      }
      for (int i = idx; i < l; i++) {
        bil2.push(s[i]);
      }
      int tmp = 0;
      while (!bil1.empty() && !bil2.empty()) {
        int x = (int)bil1.top() - '0', y = (int)bil2.top() - '0';
        bil1.pop();
        bil2.pop();
        ans2.push_back((char)((x + y + tmp) % 10) + '0');
        tmp = (x + y + tmp) / 10;
      }
      while (!bil1.empty()) {
        int x = (int)bil1.top() - '0';
        bil1.pop();
        ans2.push_back((char)((x + tmp) % 10) + '0');
        tmp = (x + tmp) / 10;
      }
      while (!bil2.empty()) {
        int x = (int)bil2.top() - '0';
        bil2.pop();
        ans2.push_back((char)((x + tmp) % 10) + '0');
        tmp = (x + tmp) / 10;
      }
      if (tmp > 0) ans2.push_back((char)tmp + '0');
    }
    reverse(ans1.begin(), ans1.end());
    reverse(ans2.begin(), ans2.end());
    if (ans1 == "")
      cout << ans2 << "\n";
    else if (ans2 == "")
      cout << ans1 << "\n";
    else if (ans1.length() < ans2.length())
      cout << ans1 << "\n";
    else if (ans1.length() > ans2.length())
      cout << ans2 << "\n";
    else {
      if (ans1 < ans2)
        cout << ans1 << "\n";
      else
        cout << ans2 << "\n";
    }
  }
}
