Today in gym class, your class decided to play dodgeball, and students are lined up in a row, waiting to be put on teams. is allowed to pick multiple students as long as they are adjacent to one another, and the first letter of each of their names are the same (case insensitive).
is selected as one of the team captains!As an assistant to
, help him decide what his first choice should be by writing a program to determine all the possible choices he could make!Input Specification
The first line contains the integer , representing the total number of students.
The second line contains space separated strings, each representing the name of the student in line. Each name will be no longer than characters and only contain letters from the English alphabet.
Output Specification
Output one integer, representing the total number of choices .
can make. Since this number can be very large, output it moduloSample Input
5
Sarah Timmy Turner Betty Bob
Sample Output
7
Explanation for Sample Output
The possible groups of people that
could choose are:- Sarah
- Timmy
- Turner
- Betty
- Bob
- Timmy, Turner
- Betty, Bob
Comments
What is output for:
Is it 11 ?
10