Trims input of trailing whitespace before parsing it - so correctly handles inputs such as '  0 1  1'