the state's second-most populous county and the third-most populous county on the island of Ireland. County Cork is located in the province of Munster, bordering Kerry to the west, Limerick to the north, Tipperary to the north-east and Waterford to the east. The county shares separate mountainous borders with Tipperary and Kerry. The terrain on the Kerry border was formed between 360 and 374 million years ago, as part of the rising of the MacGillycuddy's Reeks and Caha Mountains mountains ranges. This occurred during the Devonian period when Ireland was part of a larger continental landmass and located south of the equator. The region's topography of peaks and valleys are characterised by steep ridges formed during the Hercynian period of folding and mountain formation some 300 million years ago. Baronies Twenty-four historic baronies are in the county—the most of any county in Ireland. While baronies continue to be officially defined units, they are no longer used for many administrative purposes. Their official status is illustrated by Placenames Orders made since 2003, where official Irish names of baronies are listed. Civil parishes and townlands The county has 253 civil parishes. Townlands are the smallest officially defined geographical divisions in Ireland, with about 5447 townlands in the county. Mountains and upland habitats The county's mountains rose during a period mountain formation some 374-360 million years ago and include the Slieve Miskish and Caha Mountains on the Beara Peninsula, the Ballyhoura Mountains on the border with Limerick and the Shehy Mountains which contain Knockboy (706 m), the highest point in Cork. The Shehy Mountains are on the border with Kerry and may be accessed from the area known as Priests Leap, near the village of Coomhola. The upland areas of the Ballyhoura, Boggeragh, Derrynasaggart, and Mullaghareirk Mountain ranges add to the range of habitats found in the county. Important habitats in the uplands include blanket bog, heath, glacial lakes, and upland grasslands. Cork has the 13th-highest county peak in Ireland. Rivers and lakes Three rivers, the Bandon, Blackwater, and Lee, and their valleys dominate central Cork. Habitats of the valleys and floodplains include woodlands, marshes, fens, and species-rich limestone grasslands. The River Bandon flows through several towns, including Dunmanway to the west of the town of Bandon before draining into Kinsale Harbour on the south coast. Cork's sea loughs include Lough Hyne and Lough Mahon, and the county also has many small lakes.