The sum of three smallest factors (including 1) of the number N equals 6, and the sum of the three greatest factors of N (including N itself) equals 462. What is the value of N?

You will get brainiest if you include a detailed explanation. Thank You!