Influxdb count distinct field

Hi,
My table is a follow;

names
1.name
1.name
1.name
2.name
2.name
3.name

The result I want to get is as follows;

name    count
1.name  3
2.name  2
3.name  1

My request is

select distinct(name) from names where name=! /.*name*/ group by name

or

select count(distinct(name)) from names where name=! /.*name*/ group by name

My response

1.name
2.name
3.name

or

count 3

Thank for help