Converts letter strings into numbers