50_B. Choosing Symbol Pairs_17206
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
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
public class Main {
	//YOU CAN DO IT ....
	//Do what you love to do and give it your very best. Whether it's business or baseball, or the theater, or any field.
	//If you don't love what you're doing and you can't give it your best, get out of it. Life is too short. You'll be an old man before you know it.
	//Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.
static int n; static int m; static int ans;static long count; static int flag=1;
static int arr[];static int arr2[];static boolean visited[];
static ArrayList<Integer> s[];static ArrayList<Integer>list;
static class pair{int first,second;public pair(int x,int y){x=first;y=second;}}
    public static void main(String[] args) throws FileNotFoundException {
    	Scanner sc = new Scanner(System.in);
    	//Scanner sc=new Scanner(new File("tabs.in"));
    	String s=sc.next();int[] arr=new int[265];
    	for(int i=0;i<s.length();i++)
    	{
    		arr[s.charAt(i)]++;
    	}
    	
    	for(int i=0;i<265;i++)
    	{
    		long x=arr[i];
    		count+=x*x;
    	}
    	
    	System.out.print(count);
    	
    } }