Susan saw birds and mice eating seeds on the ground. She counted 14 heads and 40 legs in total. How many birds and mice are on the ground?