Which District has a First elected of 1858, and a Result of retired republican gain, and an Incumbent of william millward?
CREATE TABLE "united_states_house_of_representatives_e" (
  "district" text,
  "incumbent" text,
  "party" text,
  "first_elected" real,
  "result" text
);
SELECT "district" FROM "united_states_house_of_representatives_e" WHERE "first_elected"=1858 AND "result"='retired republican gain' AND "incumbent"='william millward';