If Richard bought two boxes of batteries at Sam's and each box had 4 packages containing 4 rows of 4 batteries each, how many batteries did Richard buy?