Problem: There is a given string S consisting of N symbols. Your task is to find the number of ordered pairs of integers i and j such that

1. 1 ≤ i, j ≤ N

2. S[i] = S[j], that is the i-th symbol of string S is equal to the j-th.

Input

The single input line contains S, consisting of lowercase Latin letters and digits. It is guaranteed that string S in not empty and its length does not exceed 105.

Output

Print a single number which represents the number of pairs i and j with the needed property. Pairs (x, y) and (y, x) should be considered different, i.e. the ordered pairs count.

Examples

Input

great10


Output

7


Input

aaaaaaaaaa


Output

100

Solution (in JAVA):

Solution:
import java.util.*;
import java.math.BigInteger;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Test {

    static FastReader sc = new FastReader();

    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder(sc.nextLine());
        int length = sb.length();
        long result = 0;
        long[] arr = new long[129];
        for (int i = 0; i < length; i++) {
            arr[(int)sb.charAt(i)]++;
        }
        for (int i = 0; i < 129; i++) {
            result += arr[i] * arr[i];
        }
        System.out.println(result);
    }

    // ARRAY STARTS

    static void sortMatrix(int[][] arr) {
        Arrays.sort(arr, new java.util.Comparator<int[]>() {
            public int compare(int[] a, int[] b) {
                return Integer.compare(a[0], b[0]);
            }
        });
    }

    static void sortMatrix(long[][] arr) {
        Arrays.sort(arr, new java.util.Comparator<long[]>() {
            public int compare(long[] a, long[] b) {
                return Long.compare(a[0], b[0]);
            }
        });
    }

    static void makeArray(int[] arr) {
        int length = arr.length;
        for (int i = 0; i < length; i++) {
            arr[i] = sc.nextInt();
        }
    }

    static void reverseArray(int[] arr) {
        int length = arr.length;
        for (int i = 0; i < length / 2; i++) {
            swap(arr, i, length - 1 - i);
        }
    }

    static void swap(int[] arr, int i, int j) {
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }

    static void shuffleArray(int[] arr) {
        Random rand = new Random();
        int length = arr.length;
        for (int i = length - 1; i > 0; i--) {
            int j = rand.nextInt(i + 1);
            swap(arr, i, j);
        }
    }

    static void printArray(int[] arr) {
        for (int i : arr) {
            System.out.print(i + " ");
        }
    }

    // ARRAY ENDS

    // IS PALINDROME STARTS

    static boolean isPalindrome(String s) {
        int length = s.length();
        for (int i = 0; i < length / 2; i++) {
            if (s.charAt(i) != s.charAt(length - 1 - i)) {
                return false;
            }
        }
        return true;
    }

    // IS PALINDROME ENDS

    // IS PRIME STARTS

    static boolean isPrime(int n) {
        return BigInteger.valueOf(n).isProbablePrime(1);
    }

    static boolean isPrime(long n) {
        return BigInteger.valueOf(n).isProbablePrime(1);
    }

    // IS PRIME ENDS

    // FAST READER STARTS

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    // FAST READER ENDS

}