Let c be the amount of time the butterfly spends in a cocoon and l be the amount of time it spends as a larva.

We know that l = 3c and l + c = 120.

Substituting the first equation into the second equation, we get 3c + c = 120.

Combining like terms, we get 4c = 120.

Dividing both sides by 4, we get c = 30.

# Answer

30
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
It takes a butterfly egg 120 days to become a butterfly. If each butterfly spends 3 times as much time as a larva as in a cocoon, how long does each butterfly spend in a cocoon?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
30
It takes a butterfly egg 120 days to become a butterfly. If each butterfly spends 3 times as much time as a larva as in a cocoon, how long does each butterfly spend in a cocoon?
train