/** We will use this program as follows
	java RedirectionCount < filename
    It will read from the file and print the number of lines and of tokens
    in that file
*/

import java.util.Scanner;

public class RedirectionCount
{
    public static void main(String[] args) {
	int numberOfLines = 0;
	int numberOfTokens = 0;
	Scanner scan = new Scanner(System.in);
	while (scan.hasNextLine()) {
	    String aLine = scan.nextLine();
	    numberOfLines++;
	    Scanner ls = new Scanner(aLine);
	    while (ls.hasNext()) {
		String token = ls.next();
		numberOfTokens++;
	    }
	}
	System.out.println("Number of Lines = " + numberOfLines);
	System.out.println("Number of tokens = " + numberOfTokens);
    }
}
