# a = int(input())
# sum = 0

# for i in range(1, a+1):
#   b = int(input().strip())
#   sum += b

# print(sum)

a = int(input())
b = input()
sum = 0

for i in range(a):
    sum += int(b[i])

print(sum)
