The pupils of class 5A had a total of 2015 pencils. One of them lost a box with five pencils, and instead bought a box with 50 pencils. How many pencils do the pupils of class 5A now have?