h, w = gets.split.map(&:to_i)
s = Array.new(h){gets.chomp.chars}
u = []
h.times do |i|
  a = s[i].join('').split('.').map{_1.size > 0 ? '0' * _1.size : nil}.compact
  b = s[i].join('').split('#').map{_1.size > 0 ? _1.size.to_s * _1.size : nil}.compact
  if s[i][0] == '#'
    u << a.zip(b).flatten.join('')
  else
    u << b.zip(a).flatten.join('')
  end
end
v = []
x = s.transpose
w.times do |i|
  a = x[i].join('').split('.').map{_1.size > 0 ? '0' * _1.size : nil}.compact
  b = x[i].join('').split('#').map{_1.size > 0 ? _1.size.to_s * _1.size : nil}.compact
  if x[i][0] == '#'
    v << a.zip(b).flatten.join('')
  else
    v << b.zip(a).flatten.join('')
  end
end
max = 0
h.times do |i|
  w.times do |j|
    max = u[i][j].to_i + v[j][i].to_i if max < u[i][j].to_i + v[j][i].to_i
  end
end
puts max - 1