A person sold a chair at a loss of 20%. If he had sold it for Rs 50 more, he would have gained 5%. Find the cost price of the chair.