using System; using System.Linq; using System.Collections.Generic; namespace apps { class Program { static string Get() { return Console.ReadLine(); } static void Main() { string input = Get(); Dictionary occurances = new Dictionary(); foreach (char c in input) { if (c == ' ') { continue; } if ( occurances.ContainsKey(c) == false ) { occurances.Add(c, 1); } else { occurances[c]++; } } foreach (var v in occurances) { Console.WriteLine($"{v.Key} -> {v.Value}"); } }// END MAIN } }