I would write out a bunch of examples until you see a pattern. What if the user enters 'z' and 5? What about 'y' and 3? Keep writing examples until a pattern emerges, then use that pattern to come up...