Like most insects, cockroaches have six legs. The legs are segmented, and all of them are attached to the middle part of the cockroach's body, which is known as the thorax.
The cockroach's thorax is further divided into three segments: the prothorax, the mesothorax and the metathorax. Each of the segments has a pair of spiny legs that are also known as cursorial legs, which means they are used for running.
Cockroach legs can grow back if they're lost. Cockroaches molt, or shed their exoskeletons, in order to grow. They sometimes postpone a molt until a lost leg has grown back.