3 days in Amsterdam, 2 in Copenhagen.
Unless you want to use a day in Sweden while you are in Copenhagen.
About half hour train trip across the bridge to Malmö, about quarter hour more to Lund.
You can easily visit both cities in one day.
http://en.m.wikipedia.org/wiki/Lund
http://en.m.wikipedia.org/wiki/Malmö
If of interest, SAS (Scandinavian Airlines) often have cheap single tickets between Amsterdam and Copenhagen.