#!/usr/bin/env tclsh set total 0 while {[gets stdin line] >= 0} { if {$line eq ""} { incr total [array size answer] array unset answer } foreach c [split $line {}] { set answer($c) 1 } } incr total [array size answer] puts $total