SP2426 PLD - Palindromes

Description

A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction, e.g. 'racecar', 'solos'. ### Task You are given a number k (2≤k≤30000) and a non-empty string S whose length does not exceed 30000 lowercase letters. We say two palindromes are different when they start from different positions. How many different palindromes of the length k does S contains?

Input Format

The first line contains K. The second line contains S. K does not exceed the length of S.

Output Format

The first and only line should consist of a single number - the number of palindromes found.