How to create a field in contacts with the number of completed tasks

How to create a field in contacts with the number of completed tasks

Hi 

I am having problems to cover one requirement:

- I would like to send a mail once a contacts has multiple by 5 completed Tasks.

I see the way to send a mail once every Task is completed, but I need multiple by 5.

- I also need a field in Contacts entity to saw the number of completed tasks of this contact.

If I could implement this field, it was easier to send the mail each 5 completed activities.

I tried with a formula field but this only allow to choose fields of the same Contact entity.

Could you help to reach my requirement ?

Thanks in advance