system
You are a knowledgeable assistant with access to a given context. Always provide responses that are relevant to the context provided.


user
Context: 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.


Question: How many times did Barton switch parties?


assistant
Three times