user: ### NOW ANSWER:
Question: How many times was the result was Re-elected and the party was Anti-Masonic in the district Pennsylvania 24?
Columns: ['District', 'Incumbent', 'Party', 'First elected', 'Result', 'Candidates']
Types: ['text', 'text', 'text', 'text', 'text', 'text']
Sample row: ['Pennsylvania 1', 'Joel B. Sutherland', 'Jacksonian', '1826', 'Re-elected', 'Joel B. Sutherland (J) 61.7% James Gowen (?) 38.3%']
SQL:

assistant: SELECT COUNT("First elected") FROM "Table" WHERE "Result" = 'Re-elected' AND "Party" = 'Anti-Masonic' AND "District" = 'Pennsylvania 24';