Translating word problems into mathematical expressions