Sarah bought bananas, apples and pears. The ratio of bananas to apples was 3 to 5 and the ratio of apples to pears was 4 to 2. She bought 12 bananas. How many pears did she buy?