s=gets;puts ['^*','*^'].map{|t|s.scan(t).size}.join(' ')