He has a magic sword that can, in one stroke, chop off either one head, two heads, one tail, or two tails.

This dragon is of a type related to the hydra; if one head is chopped off, a new head grows. In place of one tail, two new tails grow; in place of two tails, one new head grows; if two heads are chopped off, nothing grows.

What is the smallest number of strokes required to chop off all the dragon's heads and tails, thus killing it?