<|im_start|>user
How many times did Barton switch parties?

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.<|im_end|>
<|im_start|>assistant
Three times<|im_end|>
