import java.io.*; import java.util.*; import java.util.stream.*; 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()) { counts[c - 'A']++; total++; } 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 num : counts) { for (int i = 2; i <= num; i++) { int x = i; for (int j = 2; j <= Math.sqrt(x); j++) { while (x % j == 0) { all.put(j, all.get(j) - 1); x /= j; } } if (x > 1) { all.put(x, all.get(x) - 1); } } } int ans = 1; for (int x : all.keySet()) { int v = all.get(x); for (int i = 0; i < v; i++) { ans *= x; ans %= MOD; } } ans += MOD - 1; ans %= MOD; System.out.println(ans); } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); 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 int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }