Coupling between ferromagnets through a superconducting layer