h,w=gets.split.map(&:to_i)
m=$<.map{|s|s.chomp.split('').map{|m|m=='#'? 1 : 0 }}
rw=m.map{|m|m.map{0}}
rh=m.map{|m|m.map{0}}.transpose
m.each_with_index do |e, i|
  t=0
  e.each_with_index do |ee, ii|
    if ee.zero?
      t += 1
    else
      rw[i].fill(t,ii-t...ii)
      t=0
    end
  end
  rw[i].fill(t,-t..-1) if e[-1].zero?
end

m = m.transpose
m.each_with_index do |e, i|
  t=0
  e.each_with_index do |ee, ii|
    if ee.zero?
      t += 1
    else
      rh[i].fill(t,ii-t...ii)
      t=0
    end
  end
  rh[i].fill(t,-t..-1) if e[-1].zero?
end

rh=rh.transpose

max = 0

rh.each_with_index do |e, i|
  e.each_with_index do |ee, ii|
    max = ee+ rw[i][ii] if ee+ rw[i][ii] > max
  end
end
p max-1
