Nebojsa's answer is good, but here's a little more information and an answer to magmabyte's comment.
dmidecode
gives you the number of slots, however, those slots are not the only things using the PCI bridge which is why you see many more devices than slots.
Secondly, you may see multiple "devices" per slot, but they are likely just multiple ports on the same card. To give you an example using network interface cards (NICs):
megaman@someserver $ lspci | grep 10Gb
07:00.0 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (rev 02)
07:00.1 Ethernet controller: Emulex Corporation OneConnect 10Gb NIC (rev 02)
dmidecode
indicates that this server has three slots (and it does). Slot 1 has the 10Gb NIC above (you can see that it has 2 ports), slot 2 has a fibre channel card (which also happens to have 2 ports), and finally slot 3 is empty.
There are three physical slots in the server, one is empty, two are filled with multi port cards (an HBA and a NIC).
To answer your question in the comment, the 3 slots you have are the ones indicated by dmidecode
and they are likely populated with multi port interface cards.