# coding: utf-8 str = gets.chomp max = 0 len = 0 0.upto(str.length-1) do |i| if str[i] == "…" then len += 1 max = [len, max].max else len = 0 end end p max