If there are 11 blue balls, then there are 2 * 11 = 22 red balls.
The total number of blue and red balls is 11 + 22 = 33.
Since Ryan has 40 balls in total, the number of green balls is 40 - 33 = 7.
#### 7
The answer is: 7
Below is a math problem. Provide a detailed, step-by-step solution.

### Problem:
Ryan has 40 balls. There are twice as many red balls as blue while the rest are green. If there are 11 blue balls, how many green balls are there?

### Answer:
