Ram buys 40 pencils for Rs 70 and sells them at the rate of 30 pencils for Rs 80. Find gain or loss percent.