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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
        HashMap<Character, Long> d = new HashMap<Character, Long>();

        d.put('q', (long)0);
        d.put('w', (long)0);
        d.put('e', (long)0);
        d.put('r', (long)0);
        d.put('t', (long)0);
        d.put('y', (long)0);
        d.put('u', (long)0);
        d.put('i', (long)0);
        d.put('o', (long)0);
        d.put('p', (long)0);
        d.put('a', (long)0);
        d.put('s', (long)0);
        d.put('d', (long)0);
        d.put('f', (long)0);
        d.put('g', (long)0);
        d.put('h', (long)0);
        d.put('j', (long)0);
        d.put('k', (long)0);
        d.put('l', (long)0);
        d.put('z', (long)0);
        d.put('x', (long)0);
        d.put('c', (long)0);
        d.put('v', (long)0);
        d.put('b', (long)0);
        d.put('n', (long)0);
        d.put('m', (long)0);
        d.put('0', (long)0);
        d.put('1', (long)0);
        d.put('2', (long)0);
        d.put('3', (long)0);
        d.put('4', (long)0);
        d.put('5', (long)0);
        d.put('6', (long)0);
        d.put('7', (long)0);
        d.put('8', (long)0);
        d.put('9', (long)0);

        char[] s = b.readLine().toCharArray();
        long aux;
        for (int i = 0; i < s.length; i++) {
            if (d.containsKey(s[i])) {
                aux = d.get(s[i]);
                aux++;
                d.put(s[i], aux);
            }
        }

        long suma = 0;
        Iterator it = d.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry e = (Map.Entry) it.next();
            aux = (Long)e.getValue();
            suma = suma + (long)Math.pow(aux, 2);
        }

        System.out.println((long)suma);
    }
}