CREATE TABLE table_24329520_4 (times_contested INT, county VARCHAR)

Name the most times contested for montgomeryshire
SELECT MAX(times_contested) FROM table_24329520_4 WHERE county = "Montgomeryshire"
SELECT MAX("times_contested") FROM "table_24329520_4" WHERE "Montgomeryshire" = "county"