A candy store sells two types of candies: chocolate and gummy candies. Each chocolate candy costs $2 and each gummy candy costs $1. A customer decides to buy a total of 20 candies, spending a total of $36 on them. How many chocolate candies did the customer buy?
Let c represent the number of chocolate candies and g represent the number of gummy candies. We can set up the following system of equations based on the problem statement:
$c + g = 20$
$2c + g = 36$
Using these equations, solve for c.