Alkanes have the general formula CnH2n+2

This means that to work out the number of hydrogens, you double the number of carbons and then add two.