A sack of wheat costs 80 dollars and a sack of barley costs 50 dollars. Annie buys several sacks of each kind and spends 340 dollars. How many sacks of wheat did Annie buy?