The cost of a bag of almonds is nine times the cost of an ear of corn. Also, the cost of a bag of almonds equals 40 more than the cost of 5 ears of corn. Find the cost of a bag of almonds.