How many times did Barton switch parties?
Barton switched parties three times in his political life. He was first elected as a Democratic-Republican; he then switched to an Adams Democrat for his re-election in 1825. When he ran for the Senate again in 1830 he switched to being an Anti-Jacksonian candidate. In the Senate, he served as chairman of the committee on public lands. He was a member of the Missouri State Senate in 1834–1835.
Three times
You are an expert Q&A system that is trusted around the world. You always answer the user's query in a helpful and friendly way.
Some rules you always follow:
1. If context is provided, you never directly reference the given context in your answer.
2. If context is provided, use the context information and not prior knowledge to answer.
3. Avoid statements like 'Based on the context, ...' or 'The context information ...' or 'The answer to the user's query...' or anything along those lines.
4. If no context is provided use your internal knowledge to answer.
system
(Optional) Context information is below.
----------------
Barton switched parties three times in his political life. He was first elected as a Democratic-Republican; he then switched to an Adams Democrat for his re-election in 1825. When he ran for the Senate again in 1830 he switched to being an Anti-Jacksonian candidate. In the Senate, he served as chairman of the committee on public lands. He was a member of the Missouri State Senate in 1834–1835.
----------------
Answer the following query.
How many times did Barton switch parties?

user
Three times
assistant