class Main {
public static void main(String[] args) {
String str = "one am the one am are am is.";
int len = [Link]();
if([Link](".") || [Link]("?"))
{
String strn = "";
for(int i=0;i<len;i++)
{
char ch = [Link](i);
if([Link](ch))
strn = strn + ch;
}
int p=0;int q= [Link]()-1;
int f = 1;
while(p<q)
{
if([Link](p) != [Link](q))
f = 0;
p++;q--;
}
if(f==1)
[Link]("Palindrome");
else
[Link]("Not Palindrome");
int max = 0;
String[] words = [Link](" ");
for(int i=0;i<[Link];i++)
{
int count = 1;
for(int j=i+1;j<[Link];j++)
{
if(words[i].equals(words[j]))
count++;
}
if(count>max)
max = count;
}
[Link]("Max="+max);
}
else
{
[Link]("Invalid");
return;
}
}
}