Megan exercises every morning for 40 minutes. She does a combination of step aerobics, which burns about 11 calories/min and stretching which burns about 4 calories/min. Her goal is to burn 335 calories during her routine. How long should she participate in each activity in order to burn 335 calories?