The first number, xxx, indicates the maximum clock speed that the memory chips support. For instance, DDR400 memories work at 400 MHz at the most, and DDR2-667 can work up to 667 MHz. It is important to notice that this is not the real clock speed of the memory: the real clock of the DDR and DDR2 memories is half the labeled clock speed. This way, in fact, DDR400 memories work at 200 MHz and DDR2-667 memories work at 333 MHz.
The second number indicates the maximum transfer rate that the memory reaches, in MB/s. DDR400 memories transfer data at 3,200 MB/s at the most, hence they are labeled as PC3200. DDR2-667 memories transfer data at 5,336 MB/s and they are labeled as PC2-5400. As you can see, we use the number “2” after “DDR” or “PC” to indicate that we are talking about DDR2 memory, not DDR.