gets a,b,o=gets,gets,0 a.chars{|c|o+=1 if b.slice!(0)!=c} p o