n = int(input()) lista = [] for x in input(): lista.append(int(x)) fab = 0 for i in range(n + 1): fab += lista[i + 1] print(fab)