def num_divisors_from_fac(fac):
    """
    Given a prime factorization fac (a dictionary of the form prime :
    exponent), returns the number of divisors of the factorized number.
    """
    acc = 1
    for p in fac:
        acc *= fac[p] + 1
    return acc