I don't know how to get rid of them but I can tell you what I do know. If the forty or fifty small leaches that you had on your feet were all the same size and located in roughly the same area on your feet then you came in contact with a big mother leach with a belly covered with a bunch of babies. They Carry them around on there belly's and when they sense you nearby they swim over to you and latch on for just a second. They give a signal to the babies to leave mom and go to the food source at which time the babies explode from there mothers belly like an expanding cloud, and then they head for you and latch on. And mom swims away.
You can find a leach with babies, attached to something and approach it with your finger and the mother will signal the babies to leave her when she senses that you are right there, and then when you pull away the cloud of baby leaches swim right back to mom. I know that the babies are not leaving mom in response to my presence because they don't swim toward me when the cloud expands, just outward, away from mom and then back if they don't run into you. or get close enough to sense you.
I don't encounter leaches in my ponds except in one place , and that's where my turtles bask. The turtles bring the few leaches that there are in the pond to the basking area and the leaches fall off the turtles and stay there. Then I go over and catch them , or they catch me, kind of a little of both, and I throw them out of the pond where they dry and die. I put them in a lily bud and throw it otherwise it's hard to throw them they're very clingy.
So this is a long round about way of saying that you might not have a whole lot of leaches, just a big one that had a lot of babies to deposit on you.
The way to get the baby leaches off of you is to rub them off with a dry towel or rag. Dry is death to a leach and a dry towel is the last thing a leach wants to see. if they could see. It dries them out and rubs them off and they can't cling to it and fall off.
So maybe the best way to reduce your leach population is to do what I do. Which is to catch them by letting them think they are catching me and then dispose of them. With the help from my turtles I keep a half acre pond nearly leach free this way.