1. 

/* @Problem 10924 Prime Words
* @Autor Markus Stadler
* @Autor Johannes Müller
*/

import java.io.*;
import java.util.StringTokenizer;

class Main {
public static void main (String[] args) throws Exception {
BufferedReader buin = new BufferedReader (new InputStreamReader (System.in));

for (String input = buin.readLine(); input != null; input = buin.readLine()){
char [] chr = input.toCharArray();
int lenght = chr.length;
int pcount = 0;
for (int x = 0; x < lenght; x++){
if (chr[x] < 'a'){
int number = 27+(chr[x]-'A');
pcount += number;
}
else {
int number = 1+(chr[x]-'a');
pcount += number;
}
}
boolean pnumber = true;
for (int check = 2; check < pcount; check++) {
if (pcount % check == 0)
pnumber = false;
}
if (pnumber == true)
System.out.println ("It is a prime word.");
else
System.out.println ("It is not a prime word.");
}
buin.close();
}
}

2.


// J. Tschannerl, D. Leib


import java.io.*;

public class Main {

public static int getvalue(char c){
int i = 0;
if (Character.isLowerCase(c)){
i = (int)c - 96;
}
else{
i = (int)c - 38;
}
return i;


}
public static boolean isprime(int n){

if (n == 1 || n == 2) {
return true;
}
else if (n % 2 == 0) {
return false;
}
else {
for (int i=3; i*i<=n; i+=2) {
if (n%i==0) {
return false;
}
}
return true;
}

}

public static void main(String[] args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();

while(line != null)
{
line = line.trim();
int value = 0;
for(int i = 0; i < line.length(); i++)
{
value += getvalue(line.charAt(i));
}
if(isprime(value)){
System.out.println("It is a prime word.");
}
else{
System.out.println("It is not a prime word.");
}
line = br.readLine();
}
System.exit(0);

}

}