using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var A = Console.ReadLine(); var P = (int)Math.Pow(2, A.Length); var l = new List(); while (P > 0) { P--; var a = A; var p = Convert.ToString(P, 2); var b = ""; while (p.Length < a.Length) { p = "0" + p; } for(var i = 0; i < p.Length; i++) { switch (p[i]) { case '0': b += a[0]; a = a.Remove(0, 1); break; case '1': b += a[a.Length - 1]; a = a.Remove(a.Length-1, 1); break; } } l.Add(b); } Console.WriteLine(l.Distinct().Count()); } } }