That is the ideal ratio re Calcium and Magnesium. But I personally -and many others-take as much Magnesium as Calcium because most of us are magnesium depleted.
I understand your situation with Melatonin. Just buy an smaller dosage when you are done with that bottle, and keep in mind that you will need to wait several weeks to feel its benefits.