Count of machines by memory size

this is probably pretty simple, this query

round(last_over_time(host_ram_total_bytes{host=~“.*”}[1h])/1024/1024/1024) gives me machines buckets by memory size like 389, 768, 1024

i want to get the count of hosts in each bucket?