H, W = gets.split.map(&:to_i)
Ss = readlines.map{|l| l.split('')}

vs = Ss.map{|l| l.chunk{|c| c == '.'}.flat_map{|b, a| l = a.length; [b ? l : 0] * l}}
hs = Ss.transpose.map{|l| l.chunk{|c| c == '.'}.flat_map{|b, a| l = a.length; [b ? l : 0] * l}}.transpose
puts vs.flatten.zip(hs.flatten).map{|v, h| v + h}.max - 1