Can you give me some step-by-step instructions for this math 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?