def atoi(x): if x == '': return 0 else: return int(x) _ = int(input()) s = input() n = len(s) l = r = n // 2 while l >= 0 and s[l] == '0': l -= 1 while r < n and s[r] == '0': r += 1 if l == r: print(min(atoi(s[:sp]) + atoi(s[sp:]) for sp in [n // 2, (n + 1) // 2])) else: print(min(atoi(s[:sp]) + atoi(s[sp:]) for sp in [l, r]))