#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a >= b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a <= b)
    return a;
  else
    return b;
}
long long diff(long long a, long long b) {
  if (a >= b)
    return a - b;
  else
    return b - a;
}
long long isPrime(long long n) {
  if (n < 2) return 0;
  if (n < 4) return 1;
  if (n % 2 == 0 or n % 3 == 0) return 0;
  for (long long i = 5; i * i <= n; i += 6)
    if (n % i == 0 or n % (i + 2) == 0) return 0;
  return 1;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void sort(long long arr[], long long n) {
  for (long long i = 0; i <= n; i++) {
    for (long long j = i; j <= n; j++) {
      if (arr[i] > arr[j]) {
        long long t = arr[i];
        arr[i] = arr[j];
        arr[j] = t;
      }
    }
  }
}
long long modd(long long n, long long m) {
  if (n - m > 0) {
    return n - m;
  } else {
    return m - n;
  }
}
long long fact(long long n) {
  if (n == 1) {
    return 1;
  } else {
    return n * fact(n - 1);
  }
}
long long mod(long long n) {
  if (n >= 0) {
    return n;
  } else {
    return -n;
  }
}
long long isperfectsquare(long long n) {
  long long k = sqrt(n);
  if (n % k == 0 && n / k == k) {
    return 1;
  } else {
    return 0;
  }
}
void pairsort(long long a[], long long b[], long long n) {
  pair<long long, long long> pairt[n];
  for (long long i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (long long i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long ispalindrome(string s) {
  long long palindrome = 1;
  long long n = s.length();
  for (long long i = 0; i < (n / 2); i++) {
    if (s[i] != s[n - 1 - i]) {
      palindrome = 0;
      break;
    }
  }
  return palindrome;
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
string longsum(string n1, string n2) {
  string s1 = "";
  string s2 = "";
  long long carry = 0;
  long long n = min(n1.length(), n2.length());
  if (n1.length() != n2.length()) {
    if (n1.length() == n) {
      long long diff = n2.length() - n;
      while (diff--) {
        s2 += '0';
      }
      for (long long i = 0; i < n1.length(); i++) {
        s2 += n1[i];
      }
      n1 = s2;
      s2 = "";
    } else {
      long long diff = n1.length() - n;
      while (diff--) {
        s2 += '0';
      }
      for (long long i = 0; i < n2.length(); i++) {
        s2 += n2[i];
      }
      n2 = s2;
      s2 = "";
    }
  }
  long long length = max(n1.length(), n2.length());
  for (long long i = length - 1; i >= 0; i--) {
    long long sum = n1[i] - 48 + n2[i] - 48 + carry;
    carry = sum / 10;
    s1 += (sum % 10) + 48;
  }
  if (carry) {
    s2 += (carry + 48);
  }
  for (long long i = 0; i < length; i++) {
    s2 += s1[length - i - 1];
  }
  return s2;
}
long long compstr(string s1, string s2) {
  if (s1.length() != s2.length()) {
    if (s1.length() > s2.length()) {
      return 1;
    } else {
      return 0;
    }
  } else {
    for (long long i = 0; i < s1.length(); i++) {
      if (s1[i] > s2[i]) {
        return 1;
      } else if (s1[i] < s2[i]) {
        return 0;
      }
    }
  }
  return 1;
}
int32_t main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string n1 = "";
  string n2 = "";
  string ans = "";
  string ans1 = "";
  string ans2 = "";
  if (s[n / 2] != '0') {
    for (long long i = 0; i < n / 2; i++) {
      n1 += s[i];
    }
    for (long long i = n / 2; i < n; i++) {
      n2 += s[i];
    }
    ans = longsum(n1, n2);
    n1 = "";
    n2 = "";
    if (s[n / 2 + 1] != '0') {
      for (long long i = 0; i <= n / 2; i++) {
        n1 += s[i];
      }
      for (long long i = n / 2 + 1; i < n; i++) {
        n2 += s[i];
      }
      ans2 = longsum(n1, n2);
    }
    if (compstr(ans2, ans)) {
      cout << ans;
    } else {
      cout << ans2;
    }
    return 0;
  } else {
    long long index = n / 2;
    while (s[index] == '0' && index < n) {
      index++;
    }
    for (long long i = 0; i < index; i++) {
      n1 += s[i];
    }
    for (long long i = index; i < n; i++) {
      n2 += s[i];
    }
    ans = longsum(n1, n2);
    n1 = "";
    n2 = "";
    ans1 = "";
    index = n / 2;
    while (s[index] == '0' && index > 0) {
      index--;
    }
    for (long long i = 0; i < index; i++) {
      n1 += s[i];
    }
    for (long long i = index; i < n; i++) {
      n2 += s[i];
    }
    ans1 = longsum(n1, n2);
    if (compstr(ans1, ans)) {
      cout << ans;
    } else {
      cout << ans1;
    }
  }
  return 0;
}
