I have an unusual name so when I meet new people my brain focuses on their reaction to my name and how they pronounce it, so I completely zone out when they tell me their name. I might remember it for a short time but almost always I forgot their name if I don’t interact with them frequently.
Use it 2-3 times in the first conversation. Hi name, bye name and maybe something in between. As long as you have enough time and it’s natural so you don’t come off as a lunatic.