Limit the number of items

Good morning, please I would like to know how can I limit the entry of items to my dataset.
I want my clients add a maximum of 3 items .They fill in a form and add an item, they must have logged in.they can add one item each time, but with a maximum of 3 items.i would like to know how to use wix code to do it. Thank you