import sys
n = int(sys.stdin.readline())
digit = sys.stdin.readline().strip()
total = 0
for i in range(n):
    total += int(digit[i])
print(total)

f1f0c5467dbdfe5de9aff4f59d04e02a406a9388
<mask token>

<mask token>
for i in range(n):
    total += int(digit[i])
print(total)

<mask token>
n = int(sys.stdin.readline())
digit = sys.stdin.readline().strip()
total = 0
for i in range(n):
    total += int(digit[i])
print(total)

import sys
n = int(sys.stdin.readline())
digit = sys.stdin.readline().strip()
total = 0
for i in range(n):
    total += int(digit[i])
print(total)
