As we calculate the the no. of grams of any molecules then we should know about every method or every conversion method how we concert gram into moles and moles into gram so in this conversion method we know that 1 mole of any atoms = 6.022*1023(avogadro's#)
So 5.82*1023 / 6.022*1023 = 9.66 gram of H2S