How can I calculate the number of branches in an alkane isomer? I am so confused. So my textbook says that


  
  2-Methylheptane has 1 branch
  2,2-Dimethylhexane has 2 branches
  


However, when I get to:


2,4-Dimethylpentane
2,2,3-Trimethylpentane
2,2,3,3-Tetramethylbutane


I have no clue how to count the number of branches from the structural formula. My textbook assumes you'd understand how to calculate the number of branches after looking at the example. Can someone please help me understand?
Each instance of a comma-delimited number in the prefix is directly indicating a branch on the "backbone" or base-chain. It's quite literally the number of numbers.

The most complicated example you have can be dissected like this:

$2,2,3,3-$ tells us to anticipate four branching groups from the base-chain on the 2nd, 2nd, 3rd, and 3rd carbons.

$Tetra$ tells us that all four branching groups are identical (since there are four total)

$methyl$ tells us the name of the branches. The $methyl$ group is a $\ce{-CH3}$ attached to the backbone.

$butane$ tells us what the backbone is; in this case, a 4-carbon ($but-$) fully-saturated carbohydrate ($-ane$).

So the molecule will look like this, with the 4 branches indicated: