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