Display counts of values that occur n times in Table?

Let’s say I have this query in loki

{tenant_id="tenantId"} 
|= `ERROR` 
| label_format date=`{{ __timestamp__ | date "2006-01-02"}}`
| pattern `<_> name=<name> `
| label_format name=`{{ .name }}` 

I want to have the data presented in a Table. When I Transform the data, I can do a Group By (date) and I can go to Calculate → All Values and then I can see all Values i.e.

[ "2024-05-14", "2024-05-14", "2024-05-14", "2024-05-13"]

Now I want to have a count, where if the same value occurs 3 times, increment it by one. so for the example above, the count will 1 one

For the example below the count will be 2

[ "2024-05-14", "2024-05-14", "2024-05-14", "2024-05-13", "2024-05-12", "2024-05-12", "2024-05-12"]

I am struggling to achieve this, can someone please help me