import math


def sum_digits_factorial(n):
    """
    Compute sum of factorials of each digit in the number n
    """
    sum_fact = 0
    while n > 0:
        sum_fact += math.factorial(n % 10)
        n //= 10

    return sum_fact