How many times did the incumbent was first elected and then lost re-election anti-masonic gain?
CREATE TABLE "table1_2668173_4" (
  "district" text,
  "incumbent" text,
  "party" text,
  "first_elected" real,
  "result" text,
  "candidates" text
);
SELECT COUNT("first_elected") FROM "table1_2668173_4" WHERE "result"='Lost re-election Anti-Masonic gain';