William Shakespeare wrote 37 plays, including tragedies, comedies, and histories. He wrote the same number of tragedies as histories, but the number of comedies he wrote is 3 less than twice the number of tragedies. How many of each type of play did Shakespeare write?