using System; using System.Collections.Generic; using System.Linq; namespace y { class Program { static void Main(string[] args) { var li1 = new List(); var s = Console.ReadLine(); li1.Add("," + s); for (int i = 0; i < s.Length; i++) { var li2 = new List(); foreach (var item in li1) { string[] ss = item.Split(','); li2.Add(ss[0] + ss[1][0] + "," + ss[1].Remove(0,1)); li2.Add(ss[0] + ss[1][ss[1].Length - 1] + "," + ss[1].Remove(ss[1].Length - 1, 1)); } li1 = li2; } Console.WriteLine(li1.Distinct().Count()); } } }