puts ([gets.split] * 2).flatten.zip(["(^^*)", "(*^^)"]).map{|ab| ab[0].scan(ab[1]).size} * " "