_,*A=*$< f=->c{A.map{|s|s.count c}.min} p f[?A]+f[?B]