h, w = gets.split.map(&:to_i)

d = Array.new(h){ gets.chomp.bytes }

ary1 = []
d.map do |row|
  row.chunk{ _1 }.map do |c, ch|
    ary1 += c == 46 ? [ch.size] * ch.size : [0] * ch.size
  end
end

ary2 = []
d.transpose.map do |row|
  row.chunk{ _1 }.map do |c, ch|
    ary2 += c == 46 ? [ch.size] * ch.size : [0] * ch.size
  end
end
ary3 = ary2.each_slice(h).to_a.transpose.flatten
ans = 0
(h * w).times do |i|
    ans = ary1[i] + ary3[i] if ans < ary1[i] + ary3[i]
end
puts ans - 1