The farmer harvested 40,578 pears last year. He kept 178 for cooking. He sold the others. How many pears were sold?