In word problems such as this there is often a lot of information given.
Summarise it a bit at a time and calculate what you can from what is given:
There were green and black beans.
The black beans were all sold over
In one calculation this would be: