The molecular formula iust is how many total number of atoms of each type are present in a molecule.
Have a close look at the structure, the large sized black atoms shown here are Carbons. Count the number of carbons, total of 5 carbons.
The smaller ones are hydrogens. Count the hydrogens they are 12.
The symbol for Carbon is C and Hydrogen is H. The molecular formula is thus C5H12.
The iupac name is Pentane