Millipedes live in moist vegetation, leaf litter, and mulch. They feed upon decaying organic matter found in these areas. Millipedes are distinguished from centipedes in that they have two pairs of legs per body segment, while centipedes have only one pair of legs per body segment. Although dozens of millipedes may be found outside buildings, few may wander inside. If they do, millipedes usually die very quickly due to lack of moisture. They can, however, survive indoors in moist basements and crawl spaces. Under the right conditions, millipede "migrations" can occur. Where considerable amounts of decaying organic matter are found, such as thick leaf litter under trees or thick thatch layers in lawns, thousands of millipedes might be produced. If the area where they live dries out, becomes too wet, or the millipede population grows too large, a migration may occur. Thousands of millipedes begin crawling in search of better living conditions. In a few cases, hundreds of thousands of millipedes are present. In such cases, keeping all millipedes out of a building is likely impossible. Treatments can help minimize the numbers, however.