Assuming the database names are correct and each database contains a table called Hosts, we still need to include the schema name in the query. So just replace <schema> with the name of the schema you have and run the query below and you should get the amount.
;WITH CTE AS ( select count(id) AS [HostSum] from companyA.<schema>.hosts UNION ALL select count(id) AS [HostSum] from companyB.<schema>.hosts UNION ALL select count(id) AS [HostSum] from companyC.<schema>.hosts ) SELECT SUM([HostSum]) AS [HostSum] FROM CTE
If you cannot use a generic table expression, you can use the following:
SELECT SUM([HostSum]) AS [HostSum] FROM ( select count(id) AS [HostSum] from companyA.<schema>.hosts UNION ALL select count(id) AS [HostSum] from companyB.<schema>.hosts UNION ALL select count(id) AS [HostSum] from companyC.<schema>.hosts ) AS A
source share