A fruit vendor bought 36 pineapples for $30. He sold some at $1.29 each and the rest at $1.09, thereby gaining $13.64. How many did he sell at each price?