Cost of letters (#585) - Azerbaijan Computing Olympiad