Measurement of the decay amplitudes of B-0 -> J/psi K*(0) and B-S(0) -> J/psi phi decays