This page is still under construction.

Parts of this page are still being built. What you see may change.

SGA President

Time limit1sMemory limit1024 MB

Level

Not classified yet

Solved
No attempts yet

Statement

Timothy and Alex are no longer eligible for ICPC, so they want to run for SGA President and Vice President. Past winning tickets such as Josh/Jad and Brad/Breon each had two distinct names that start with the same first letter. Timothy and Alex do not fit that pattern, so they cannot win.

Given the first name of every UCF student, count the President/Vice President pairs that could win. A pair is possible when the two names are different and start with the same letter. The first name in the pair is the President candidate and the second is the Vice President candidate, so Josh/Jad and Jad/Josh count separately. Students may share a first name. If there are 10 Joshes and 3 Jads, there are 30 Josh/Jad pairs, and all of them count.

Input

The first line contains a single positive integer n≤66183n \le 66183, the number of UCF students. Each of the next nn lines contains the first name of one student. Names consist only of uppercase letters and are between 1 and 20 letters long. Each line is a distinct student, and different students may have the same first name.

Output

Print the number of President/Vice President pairs that have a chance to win the SGA election, on a line by itself.

Examples2

  1. Example 1

    Input
    10
    JOSH
    JAD
    JENNIFER
    JENNIFER
    JALEN
    HASAAN
    ALI
    TIM
    ALEX
    TRAVIS
    
    Expected output
    22
    
  2. Example 2

    Input
    5
    ALEX
    BRANDY
    CELINE
    DWAYNE
    ELIZABETH
    
    Expected output
    0