import java.util.*; import java.io.*; public class Main { static final int MOD = 573; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int[] counts = new int[26]; int total = 0; for (char c : sc.next().toCharArray()) { total++; counts[c - 'A']++; } HashMap all = new HashMap<>(); for (int i = 2; i <= total; i++) { int x = i; for (int j = 2; j <= Math.sqrt(x); j++) { while (x % j == 0) { all.put(j, all.getOrDefault(j, 0) + 1); x /= j; } } if (x > 1) { all.put(x, all.getOrDefault(x, 0) + 1); } } for (int x : counts) { for (int i = 2; i <= x; i++) { int y = i; for (int j = 2; j <= Math.sqrt(y); j++) { while (y % j == 0) { all.put(j, all.get(j) - 1); y /= j; } } if (y > 1) { all.put(y, all.get(y) - 1); } } } long ans = 1; for (int x : all.keySet()) { ans *= pow(x, all.get(x)); ans %= MOD; } ans = (ans - 1 + MOD) % MOD; System.out.println(ans); } static long pow(long x, int p) { if (p == 0) { return 1; } else if (p % 2 == 0) { return pow(x * x % MOD, p / 2); } else { return pow(x, p - 1) * x % MOD; } } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String nextLine() throws Exception { return br.readLine(); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }