If Roselyn gave Rebecca 40 books, and Mara was given three times as many books, Mara has 3*40 = 120 books.

Rebecca and Mara's total number of books is 120+40 = <<120+40=160>>160 books.

If Roselyn gave Mara and Rebecca her books, which is 160, then she initially had 60+160 = <<60+160=220>>220 books.

# Answer

220
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Roselyn gives Mara three times as many books as she gives Rebecca and remains with 60 books. If Rebecca received 40 books, how many books did Roselyn have before?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
220
Roselyn gives Mara three times as many books as she gives Rebecca and remains with 60 books. If Rebecca received 40 books, how many books did Roselyn have before?
train