Generate a Python program that takes a number as input and calculates its sum of digits.
Number: 123
n = 123
sum_of_digits = 0

while n > 0:
    digit = n % 10
    sum_of_digits += digit
    n //= 10

print("Sum of digits in 123 is:", sum_of_digits)