// Arup Guha
// 3/4/2019
// Solution to 2019 Mercer Contest Problem 8: Look for the Helpers

import java.util.*;
import java.math.*;

public class helpers {
	
	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		String line = stdin.nextLine();
		
		BigInteger res = new BigInteger("0");
		int lineNo = 1;
		
		// Process all lines.
		while (!line.equals("THE END")) {
			
			// Get this number.
			StringTokenizer tok = new StringTokenizer(line);
			String num = "";
			while (tok.hasMoreTokens())
				num = num + tok.nextToken().length();
			
			// Handling a case disallowed by the problem statement, just in case...
			if (num.length() == 0) num = "0";
			
			// This line's output.
			System.out.println("Line "+lineNo+" = "+num);
			
			// Convert and add.
			BigInteger tmp = new BigInteger(num);
			res = res.add(tmp);
			
			// Get next line.
			lineNo++;
			line = stdin.nextLine();
		}
		
		System.out.println("Sum of file = "+res);
	}

}
