Number count of gravitational waves and supernovae in luminosity distance space for ΛCDM and scalar-tensor theories