days = gets.chomp.split(/x+?/) i = 0 flg = false yesbig=0 while big = days[i] do if yesbig < big.size then yesbig = big.size else end i+=1 end