using static System.Math; using System.Collections.Generic; using System.Linq; using System; public class Hello { static void Main() { var s = Console.ReadLine().Trim(); getAns(s); } static bool check(string t) { var a = 0; var b = 0; var c = 0; for (int i = 0; i < 8; i++) { var ta = t[i] - '0'; var tb = t[i] - 'a'; if (ta >= 0 && ta <= 9) a++; else if (tb >= 0 && tb <= 25) b++; else c++; } return a > 0 && b > 0 && c > 0; } static void getAns(string s) { var a = "loas"; var b = "10@$"; var ans = 0; var q = new Queue(); q.Enqueue(""); while (q.Count > 0) { var w = q.Dequeue(); var wL = w.Length; if (wL == 8) { if (check(w)) ans++; continue; } q.Enqueue(w + s[wL]); for (int i = 0; i < 4; i++) { if (s[wL] == a[i]) { q.Enqueue(w + b[i]); break; } } } Console.WriteLine(ans); } }