user: Question: How many times did the incumbent was first elected and then Lost re-election Anti-Masonic gain?
Columns: ['District', 'Incumbent', 'Party', 'First elected', 'Result', 'Candidates']
Types: ['text', 'text', 'text', 'real', 'text', 'text']
Sample row: ['Pennsylvania 6', 'Mathias Morris', 'Anti-Jacksonian', 1834.0, 'Re-elected', 'Mathias Morris (W) 51.4% John Rockman (D) 48.6%']
SQL:

assistant: SELECT COUNT("First elected") FROM "Table" WHERE "Result" = 'Lost re-election Anti-Masonic gain';