def main():

    sum = 0
    value = input("Enter a positive integer: ")

    # check that value is positive
    while value <= 0:
        value = input("Try again - enter positive integer: ")

    # compute the sum of the digits
    while value > 0:
        sum += value%10
        value /= 10

    print "Sum of digits=", sum

main()
