A farmer had twice as many chickens as ducks. If he sold 166 chickens and 29 ducks how many chickens did he have before