Back to Hostel

0

0 votes
Problem

After a long vacation due to Swine Flu, 1st Year SVNIT students have returned back to Gajjar Bhavan. Students in Gajjar Bhavan generally handshake to greet each other but due to Swine Flu it's still risky to handshake so students greet each other by just words instead of handshakes.

Bagha is an interesting(really?) Maggu. He considers a greet interesting if the word spoken by a guy is palindrome and the length of the word is prime. Help, Bagha find out the number of interesting greets other students have given to him.

Input Format :
Input starts with N denoting the number of greets given to Bagha.
Next N lines contains a string(without space) each in lowercase having the greets.

Output Format :
Output the number of greets which are both palindromes and prime in length.

Constraints : 1 ≤ N ≤ 10
1 ≤ Length of string ≤ 1000

Problem Setter : Swastik Mundra

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?