days = ((gets.chomp+gets.chomp).split(/x+/)).map(&:to_i) i = 0 yesbig=0 while big = days[i] do if yesbig < big then yesbig = big end i+=1 end puts(yesbig)