using System; using System.Collections.Generic; using System.Linq; public class Test { static void Main() { SortedDictionary text = new SortedDictionary(); string line = Console.ReadLine(); foreach (var character in line) { if (text.ContainsKey(character)) { text[character]++; } else { text.Add(character, 1); } } foreach (var character in text) { Console.WriteLine($"{character.Key} -> {character.Value}"); } } }