<reponame>Xrenya/algorithms
digit = input()

def digit_sum(digit):
    return sum([(int(x)) for x in digit])

print(digit_sum(digit))

digit = input()

def digit_sum(digit):
    return sum([(int(x)) for x in digit])

print(digit_sum(digit))