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.*;
public class ChoosingSymbolPairs 
{
	public static void main(String[] args) 
	{
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		long a[]=new long[26];
		long b[]=new long[10];
		
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i)>='a' && s.charAt(i)<='z')
			{
				a[s.charAt(i)-'a']++;
			}
			
			else if(s.charAt(i)>='0' && s.charAt(i)<='9')
			{
				b[s.charAt(i)-'0']++;
			}
		}
	//	System.out.println(Long.MAX_VALUE);
		
//		for(int i=0;i<a.length;i++)
//		{
//			System.out.print(a[i]+" ");
//		}
//		System.out.println();
//		
//		for(int i=0;i<b.length;i++)
//		{
//			System.out.print(b[i]+" ");
//		}
//		System.out.println();
		long count=0;
		for(int i=0;i<a.length;i++)
		{
			if(a[i]==1)
			{
				count=count+1;
			}
			
			else if(a[i]>1)
			{
				count=count+a[i]*(a[i]);
			}
		}
		
		for(int i=0;i<b.length;i++)
		{
			if(b[i]==1)
			{
				count=count+1;
			}
			else if(b[i]>1)
			{
				count=count+(b[i]*b[i]);
			}
		}
		System.out.println(count);
	}
}