import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class NoOfWordsInString
{
public static void main(String[] args)
throws IOException
{
System.out.println("Enter a string or number for which the number of words is to be counted: ");
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String str = br.readLine();
System.out.println("The no of words in the string are: "+str.length());
}
}