How many hit dice does a Sidekick start with?

In Tasha’s Cauldron of Everything, the published Sidekick rules say (p. 142):

A sidekick can be any type of creature […], but the challenge rating in its stat block must be 1/2 or lower. You take that stat block and add to it, as explained in the "Gaining a Sidekick Class" section.

The referenced section also says, among other things:

The starting level of a sidekick is the same as the average level of the group. […]

Whenever the group’s average level goes up, the sidekick gains a level. […]

Whenever the sidekick gains a level, it gains one Hit Die, and its hit point maximum increases. To determine the amount of the increase, roll the Hit Die (the type of die appears in the sidekick’s stat block) […]

I assume "gaining a sidekick class" counts as "the sidekick gains a level" for the purpose of hit dice, and that isn’t just talking about when the group levels up.
So does the creature start with the number of hit dice listed next to its hit points? Or does it have a pool of "free" hit points that don’t come with hit dice?

For example, a kobold has "5 (2d6 − 2)" hit points listed in its stat block, and it doesn’t mention "hit dice" as such. If a kobold becomes a sidekick to a 1st level party, does it start with a Hit Dice of 1d6 or 3d6?

It seems weird to have a sidekick starting out with 3 hit dice when it’s only 1st level, but at the same time, a 1st-level sidekick kobold with 8 HP and only a 1d6 hit die also looks sort of odd.