1 2 3 4 5 6 7 8
#!/usr/bin/env ruby1.9.1 STDIN.set_encoding('utf-8') while line = STDIN.gets puts line.split.length end