A bakery sells muffins and cookies. Each muffin costs $2 and each cookie costs $1. Last Saturday, they sold a total of 180 items, earning $320. If the number of muffins sold was twice the number of cookies sold, how many cookies did the bakery sell?