Spin-wave theory of ferromagnetic crystals containing impurities