import math

def sumdigits(n):
    sum=0
    while(n>0 or sum>9):
        if (n==0):
            n=sum
            sum=0

        sum+=n%10
        n=n//10

    return sum






x=sumdigits(38967)
print("sum of all digits: ",x)




d404be2cef46392262d3c3520bfe137eda92709a
<mask token>


def sumdigits(n):
    sum = 0
    while n > 0 or sum > 9:
        if n == 0:
            n = sum
            sum = 0
        sum += n % 10
        n = n // 10
    return sum


<mask token>

<mask token>


def sumdigits(n):
    sum = 0
    while n > 0 or sum > 9:
        if n == 0:
            n = sum
            sum = 0
        sum += n % 10
        n = n // 10
    return sum


<mask token>
print('sum of all digits: ', x)

<mask token>


def sumdigits(n):
    sum = 0
    while n > 0 or sum > 9:
        if n == 0:
            n = sum
            sum = 0
        sum += n % 10
        n = n // 10
    return sum


x = sumdigits(38967)
print('sum of all digits: ', x)

import math


def sumdigits(n):
    sum = 0
    while n > 0 or sum > 9:
        if n == 0:
            n = sum
            sum = 0
        sum += n % 10
        n = n // 10
    return sum


x = sumdigits(38967)
print('sum of all digits: ', x)

import math

def sumdigits(n):
    sum=0
    while(n>0 or sum>9):
        if (n==0):
            n=sum
            sum=0

        sum+=n%10
        n=n//10

    return sum






x=sumdigits(38967)
print("sum of all digits: ",x)



