#include <bits/stdc++.h>
using namespace std;
string compare(string a, string b) {
  if (a.length() < b.length())
    return a;
  else if (a.length() > b.length())
    return b;
  else {
    int len = a.length();
    int i = 0;
    while (i < len) {
      if (a[i] > b[i])
        return b;
      else if (b[i] > a[i])
        return a;
      else
        i++;
    }
    return a;
  }
}
void func() {
  int l;
  cin >> l;
  string num;
  cin >> num;
  if (l % 2 == 0) {
    l = l / 2;
    if (num[l] != '0') {
      vector<int> ans;
      int c = 0;
      for (int i = l - 1; i >= 0; i--) {
        int a = (int)(num[i] - '0');
        int b = (int)(num[i + l] - '0');
        int sum = a + b + c;
        c = sum / 10;
        sum = sum % 10;
        ans.push_back(sum);
      }
      if (c > 0) ans.push_back(c);
      string ans1;
      for (int i = ans.size() - 1; i > -1; i--) {
        ans1 += (char)(ans[i] + '0');
      }
      cout << ans1 << endl;
      return;
    } else {
      int l1, l2;
      l1 = l - 1;
      l2 = l + 1;
      bool fail1 = false, fail2 = false;
      while (l1 != 0 && l2 != 0) {
        if (num[l1] == '0') fail1 = true;
        if (num[l2] == '0') fail2 = true;
        if (fail1 && fail2) {
          l1 -= 1;
          l2 += 1;
          fail1 = false;
          fail2 = false;
        } else {
          break;
        }
      }
      if (!fail1 && fail2) {
        vector<int> ans;
        int c = 0;
        int i, j;
        for (i = l1 - 1, j = 2 * l - 1; i >= 0; i--, j--) {
          int a = (int)(num[i] - '0');
          int b = (int)(num[j] - '0');
          int sum = a + b + c;
          c = sum / 10;
          sum = sum % 10;
          ans.push_back(sum);
        }
        while (j >= l1) {
          int b = (int)(num[j] - '0');
          int sum = b + c;
          c = sum / 10;
          sum = sum % 10;
          ans.push_back(sum);
          j--;
        }
        if (c > 0) ans.push_back(c);
        string ans1;
        for (int i1 = ans.size() - 1; i1 > -1; i1--) {
          ans1 += (char)(ans[i1] + '0');
        }
        cout << ans1 << endl;
        return;
      } else if (fail1 && !fail2) {
        vector<int> ans;
        int c = 0;
        int i, j;
        for (i = l2 - 1, j = 2 * l - 1; j >= l2; i--, j--) {
          int a = (int)(num[i] - '0');
          int b = (int)(num[j] - '0');
          int sum = a + b + c;
          c = sum / 10;
          sum = sum % 10;
          ans.push_back(sum);
        }
        while (i >= 0) {
          int a = (int)(num[i] - '0');
          int sum = a + c;
          c = sum / 10;
          sum = sum % 10;
          ans.push_back(sum);
          i--;
        }
        if (c > 0) ans.push_back(c);
        string ans1;
        for (int i1 = ans.size() - 1; i1 > -1; i1--) {
          ans1 += (char)(ans[i1] + '0');
        }
        cout << ans1 << endl;
        return;
      } else {
        vector<int> ans;
        int c = 0;
        int i, j;
        for (i = l1 - 1, j = 2 * l - 1; i >= 0; i--, j--) {
          int a = (int)(num[i] - '0');
          int b = (int)(num[j] - '0');
          int sum = a + b + c;
          c = sum / 10;
          sum = sum % 10;
          ans.push_back(sum);
        }
        while (j >= l1) {
          int b = (int)(num[j] - '0');
          int sum = b + c;
          c = sum / 10;
          sum = sum % 10;
          ans.push_back(sum);
          j--;
        }
        if (c > 0) ans.push_back(c);
        string ans1;
        for (int i1 = ans.size() - 1; i1 > -1; i1--) {
          ans1 += (char)(ans[i1] + '0');
        }
        ans.clear();
        c = 0;
        for (i = l2 - 1, j = 2 * l - 1; j >= l2; i--, j--) {
          int a = (int)(num[i] - '0');
          int b = (int)(num[j] - '0');
          int sum = a + b + c;
          c = sum / 10;
          sum = sum % 10;
          ans.push_back(sum);
        }
        while (i >= 0) {
          int a = (int)(num[i] - '0');
          int sum = a + c;
          c = sum / 10;
          sum = sum % 10;
          ans.push_back(sum);
          i--;
        }
        if (c > 0) ans.push_back(c);
        string ans2;
        for (int i1 = ans.size() - 1; i1 > -1; i1--) {
          ans2 += (char)(ans[i1] + '0');
        }
        string res = compare(ans1, ans2);
        cout << res << endl;
        return;
      }
    }
  } else {
    int l1, l2;
    l1 = l / 2 + 1;
    l2 = l - l1;
    bool fail1 = false, fail2 = false;
    while (l1 != 0 && l2 != 0) {
      if (num[l1] == '0') fail1 = true;
      if (num[l2] == '0') fail2 = true;
      if (fail1 && fail2) {
        l1 += 1;
        l2 -= 1;
        fail1 = false;
        fail2 = false;
      } else {
        break;
      }
    }
    if (!fail1 && fail2) {
      vector<int> ans;
      int c = 0;
      int i, j;
      for (i = l1 - 1, j = l - 1; j >= l1; i--, j--) {
        int a = (int)(num[i] - '0');
        int b = (int)(num[j] - '0');
        int sum = a + b + c;
        c = sum / 10;
        sum = sum % 10;
        ans.push_back(sum);
      }
      while (i >= 0) {
        int a = (int)(num[i] - '0');
        int sum = a + c;
        c = sum / 10;
        sum = sum % 10;
        ans.push_back(sum);
        i--;
      }
      if (c > 0) ans.push_back(c);
      string ans1;
      for (int i1 = ans.size() - 1; i1 > -1; i1--) {
        ans1 += (char)(ans[i1] + '0');
      }
      cout << ans1 << endl;
      return;
    } else if (fail1 && !fail2) {
      vector<int> ans;
      int c = 0;
      int i, j;
      for (i = l2 - 1, j = l - 1; i >= 0; i--, j--) {
        int a = (int)(num[i] - '0');
        int b = (int)(num[j] - '0');
        int sum = a + b + c;
        c = sum / 10;
        sum = sum % 10;
        ans.push_back(sum);
      }
      while (j >= l2) {
        int b = (int)(num[j] - '0');
        int sum = b + c;
        c = sum / 10;
        sum = sum % 10;
        ans.push_back(sum);
        j--;
      }
      if (c > 0) ans.push_back(c);
      string ans1;
      for (int i1 = ans.size() - 1; i1 > -1; i1--) {
        ans1 += (char)(ans[i1] + '0');
      }
      cout << ans1 << endl;
      return;
    } else {
      vector<int> ans;
      int c = 0;
      int i, j;
      for (i = l1 - 1, j = l - 1; j >= l1; i--, j--) {
        int a = (int)(num[i] - '0');
        int b = (int)(num[j] - '0');
        int sum = a + b + c;
        c = sum / 10;
        sum = sum % 10;
        ans.push_back(sum);
      }
      while (i >= 0) {
        int a = (int)(num[i] - '0');
        int sum = a + c;
        c = sum / 10;
        sum = sum % 10;
        ans.push_back(sum);
        i--;
      }
      if (c > 0) ans.push_back(c);
      string ans1;
      for (int i1 = ans.size() - 1; i1 > -1; i1--) {
        ans1 += (char)(ans[i1] + '0');
      }
      ans.clear();
      c = 0;
      for (i = l2 - 1, j = l - 1; i >= 0; i--, j--) {
        int a = (int)(num[i] - '0');
        int b = (int)(num[j] - '0');
        int sum = a + b + c;
        c = sum / 10;
        sum = sum % 10;
        ans.push_back(sum);
      }
      while (j >= l2) {
        int b = (int)(num[j] - '0');
        int sum = b + c;
        c = sum / 10;
        sum = sum % 10;
        ans.push_back(sum);
        j--;
      }
      if (c > 0) ans.push_back(c);
      string ans2;
      for (int i1 = ans.size() - 1; i1 > -1; i1--) {
        ans2 += (char)(ans[i1] + '0');
      }
      string res = compare(ans1, ans2);
      cout << res << endl;
      return;
    }
  }
  return;
}
int main() {
  std::ios::sync_with_stdio(false);
  int t = 1;
  while (t--) func();
  return 0;
}
