A vendor has a certain number of frames. If he sells each of the them at Rs. 7, he gains Rs.20 on the whole, while if he sells them at Rs.8.50 each, he gains Rs.80 on the whole. At what price has he bought all the frames?