sql server – Group by on three tables as one master table and two detail tables

Master table
———————-
Ownerid ownername

  1.   Abc
    
  2.   Xyz
    
  3.   Pqr
    

Detail table 1
———————-
Detailid Listid Ownerid

  1.   1.     1
    
  2.   1.     2
    
  3.   2.     1
    
  4.   3.     1
    

Detail table 2
———————-
Detailid Tagid Ownerid

  1.   1.     1
    
  2.   1.     2
    
  3.   2.     1
    
  4.   3.     1
    

Result i want as
Ownerid Listcount Tagconut

  1.  3.        3
    
  2.  1.        1