Insects have six legs, right?

Zooming out on your question a little bit, insects have 6 (i.e. 3 pairs of) locomotory appendages, known in simple terms as ‘walking legs’; there are several additional non-locomotory appendages, such as those used as mouthparts in beetles for instance. In a typical insect, all 6 of the former will be used for locomotion, but then… there are hardly any taxa of life where the ‘typical’ form is without exception. So in the case above, as in many other insects, certain walking legs are modified to perform special functions, so they do not appear to be typical ‘legs’ - but they are present.