1. JAVA, Simon Baumgartner

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.*;


/*
* ACM Programming Contest
* Problem: 494 Kindergarten Counting Game
* Status: Accepted
* Runtime: 0.076
* Date: 2009-07-01
* Author: Simon Baumgartner
*
*/


public class Main {

public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = in.readLine();
int res = 0;
do{
res = 0;
for(String word : line.split("[^a-zA-Z]+"))
if(Pattern.matches("[a-zA-z]+", word))
res++;
System.out.println(res);
}while((line = in.readLine() ) != null);
}
}