How is a molecular formula determined?