Mary gives 1/4 * 400 = <<400*1/4=100>>100 sheep to her sister.

She now has 400 - 100 = <<400-100=300>>300 sheep remaining.

She then gives 1/2 * 300 = <<300/2=150>>150 sheep to her brother.

So 300 - 150 = <<300-150=150>>150 sheep remain.

# Answer

150
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Mary has 400 sheep on her farm. She gave a quarter of her sheep to her sister, and half of the remaining sheep to her brother. How many sheep remain with Mary?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
150
Mary has 400 sheep on her farm. She gave a quarter of her sheep to her sister, and half of the remaining sheep to her brother. How many sheep remain with Mary?
train