Word Question Processing

I am trying to be able to parse a word question e.g. " John needs 5 minutes to walk back home from school. How far is his school from his home if he walks at a constant speed of 4km/h?"
However, I am not sure how to do this.

An alternative method I have thought of is to directly use the question as the input, then put the equation as the output, which can then be evaluated by some other code. Unfortunately, I do not know how to have the output be not fixed. Any help is appreciated; thanks!