He had 20 red marbles and took away 3 leaving 20-3 = <<20-3=17>>17 red marbles

He took 4 times as many blue marbles as red marbles which is 4*3 = <<4*3=12>>12 blue marbles

He took 12 blue marbles from 30 leaving 30-12 = 18 blue marbles

He now has 17+18 = <<17+18=35>>35 marbles left

# Answer

35
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
A magician has a top hat with 20 red marbles and a top hat with 30 blue marbles. If he takes away 3 red marbles and four times as many blue marbles as red marbles (without looking), how many marbles in total does he have left?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
35
A magician has a top hat with 20 red marbles and a top hat with 30 blue marbles. If he takes away 3 red marbles and four times as many blue marbles as red marbles (without looking), how many marbles in total does he have left?
train