Count number linked records with same field value

Hello,

i have two tables A & B, i am looking to count number of records in table A that have the same value of a specific field (country).

I tried a search action with dynamic fields but it return only 100 records (i have more).
Is there any tip to count similar records without using link fields and search ?
For exmple a scrip that search and update a field.

(trigger is new or updated records)