import java.io.*; import java.util.*; public class Main { static final int MOD = 573; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int count = 0; int[] alpha = new int[26]; for (char c : sc.next().toCharArray()) { alpha[c - 'A']++; count++; } ArrayList> list = new ArrayList<>(); list.add(new HashMap<>()); list.add(new HashMap<>()); for (int i = 2; i <= count; i++) { HashMap tmp = (HashMap)list.get(i - 1).clone(); int x = i; for (int j = 2; j <= Math.sqrt(x); j++) { while (x % j == 0) { tmp.put(j, tmp.getOrDefault(j, 0) + 1); x /= j; } } if (x > 1) { tmp.put(x, tmp.getOrDefault(x, 0) + 1); } list.add(tmp); } HashMap base = (HashMap)list.get(count); for (int x : alpha) { for (int y : list.get(x).keySet()) { base.put(y, base.get(y) - list.get(x).get(y)); } } int ans = 1; for (int x : base.keySet()) { for (int i = 0; i < base.get(x); i++) { ans *= x; ans %= MOD; } } System.out.println((ans - 1 + MOD) % 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 String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }