N = int(input()) A = list(input()) ; A = list(map(int, A)) ans = sum(A) print(ans)