Answer: all of them
The rib cage is formed by 24 ribs (12 pairs). Their function is to protect the lungs, heart, and other internal organs of the thorax. They also enable the lungs to expand, facilitating breathing by expanding the chest cavity.
From those 12 pairs, 7 pairs are "true ribs" directly attached to the sternum and the rest are called "false ribs" because some are suspended or share cartilage that connects to sternum.