A man walks by a field and notices some boys and dogs playing. He counts 22 heads and 68 legs. How many boys and dogs are playing in the field?