def sum_factorial_digits(x):
    """
    Returns the sum of the factorials of the digits of x
    """
    factorials = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]
    sum_factorial_digits_ = 0
    for i in str(x):
        sum_factorial_digits_ += factorials[int(i)]
    return(sum_factorial_digits_)