Greg charges $20 per dog plus $1 per minute per dog for walking the dog.
He walks one dog for x minutes, so he earns $20 + $1*x for that.
He walks two dogs for 7 minutes, so he earns 2 * ($20 + $1*7) = 2 * ($20 + $7) = 2 * $27 = $54 for that.
He walks three dogs for 9 minutes, so he earns 3 * ($20 + $1*9) = 3 * ($20 + $9) = 3 * $29 = $87 for that.
The total amount of money he earns is the sum of the money earned for each dog: $20 + $1*x + $54 + $87.
We are given that the total amount of money he earns is $171, so we can write: $20 + $1*x + $54 + $87 = $171.
Simplifying the left side, we get: $161 + $1*x = $171.
Subtracting $161 from both sides, we get: $1*x = $10.
Dividing both sides by $1, we get: x = 10.
The value of x is 10.
#### 10
The answer is: 10
Below is a math problem. Provide a detailed, step-by-step solution.

### Problem:
Greg has his own dog walking business. He charges $20 per dog plus $1 per minute per dog for walking the dog. If he walks one dog for x minutes, two dogs for 7 minutes and three dogs for 9 minutes, how much money, in dollars, does he earn?
If we know the answer to the above question is 171, what is the value of unknown variable x?

### Answer:
