There was some flour in a container. Ann took 1/2 of the flour to make pancakes but returned 250g back to the container. She took 1/2 of the remaining flour to bake a cake but returned 400g to the container. Kim took 1/2 of the remaining flour to bake a cookies but returned 300g back to the container, how much flour was there in the container at first?