If the worms look like grains of rice, it's probably not roundworms. It sounds more like tapeworms and they come from the puppy ingesting fleas.
The only way to get rid of tapeworms is to get a medication from your vet. Just give them a call and describe the worm to them. They will usually dispense it over the phone and let you come and pick it up. The medication will be either Drontal Plus or Droncit. One pill is all it takes and then the vet may have you repeat it later.
Let me know if you still have questions.
