In Pancake Confectionery, 2/9 of the pancakes baked were strawberry pancakes, 1/3 of them were chocolate pancakes and the rest were vanilla pancakes. 5/6 of the strawberry pancakes were sold. This was 1/2 of the number of vanilla pancakes sold. The number of chocolate pancakes sold was 1/5 the total number sold in the other two flavors. Given that there were 162 pancakes left, how many pancakes were there at first?

starting with x pancakes,

strawberry: 2/9 x
chocolate: 1/3 x
vanilla: 4/9 x
sold: 5/6 * 2/9 = 5/27 x strawberry
vanilla: 10/27 x
chocolate: 1/9 x
total sold: 2/3 x
1/3 x = 162, so
x = 3*162 = 486 pancakes at first