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.
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 10<sup class="upper-index">5</sup>.

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


import java.util.Scanner;

/**
 *
 * @author Alsha
 */
public class Main{

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        int c =0;
        for (int i = 0; i < s.length(); i++) {
            for (int j = 0; j < s.length(); j++) {
                if (s.charAt(i)== s.charAt(j) ){
                    c++;
                }
            }
        }
        System.out.println(c);
         return 0 ;
    }

}

		 	       	 	 	  		 			  				