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