Farmer Bauder can't remember how many pigs and how many chickens he has. He knows that together the animals have 8 heads and 22 legs. How many pigs and how many chickens does farmer Bauder have?​