using System.Collections.Generic; using System.Linq; using System; public class P { public string s { get; set; } public string t { get; set; } } public class Hello { public static void Main() { var s = Console.ReadLine().Trim(); var ans = getAns(s); Console.WriteLine(ans); } public static int getAns(string s) { var sL = s.Length; if (sL == 1) return 1; var hs = new HashSet(); var q = new Queue

(); q.Enqueue(new P { s = s.Substring(1), t = "" + s[0] }); q.Enqueue(new P { s = s.Substring(0,sL -1), t = "" + s[sL -1] }); while (q.Count() > 0) { var w = q.Dequeue(); if (w.s == "") { hs.Add(w.t); continue; } if (w.s.Length == 1) q.Enqueue(new P { s = "", t = w.t + w.s }); else { q.Enqueue(new P { s = w.s.Substring(1), t = w.t + w.s[0] }); q.Enqueue(new P { s = w.s.Substring(0, w.s.Length - 1), t = w.t + w.s[w.s.Length - 1] }); } } return hs.Count(); } }