A school had an election where the candidates received votes in the ratio of 1:4:2. If the winning candidate received 240 votes, how many people voted in the election.