In a competitive examination, the average marks obtained was 45. It was later discovered that there was some error in computerisation and the marks of 90 candidates had to be changed from 80 to 50, and the average came down to 40 marks. The total number of candidates appeared in the examination is: