Well, that could be a lot! in a tiny tank if you kill them IN THE TANK & let the ammonia spike all up, it could be big problems. Like I said pick out that pinky/purple rock & scrub off the worms under running tap water. There may be (many?) more depending on what they are & where they came from. Skip feeding for several days & see if that helps. The shrimp should eat the dead critters but maybe not enough to prevent ammonia spikes. Keep an eye on tests; change water as needed. Usually "critters" can be a sign of a healthy tank...but just a few...you have more than a few...
Hopefully someone else knows what they are & what to do in such a small tank...