# frozen_string_literal: true

h, w = gets.split.map(&:to_i)
s = h.times.map { gets.chomp.split('') }

l = Array.new(h) { Array.new(w) { 0 } }
r = Array.new(h) { Array.new(w) { 0 } }
u = Array.new(h) { Array.new(w) { 0 } }
d = Array.new(h) { Array.new(w) { 0 } }

0.upto(h - 1) do |i|
  0.upto(w - 1) do |j|
    next if s[i][j] == '#' || j.zero? || s[i][j - 1] == '#'

    l[i][j] = l[i][j - 1] + 1
  end
end

(h - 1).downto(0) do |i|
  (w - 1).downto(0) do |j|
    next if s[i][j] == '#' || j == w - 1 || s[i][j + 1] == '#'

    r[i][j] = r[i][j + 1] + 1
  end
end

0.upto(w - 1) do |j|
  0.upto(h - 1) do |i|
    next if s[i][j] == '#' || i.zero? || s[i - 1][j] == '#'

    u[i][j] = u[i - 1][j] + 1
  end
end

(w - 1).downto(0) do |j|
  (h - 1).downto(0) do |i|
    next if s[i][j] == '#' || i == h - 1 || s[i + 1][j] == '#'

    d[i][j] = d[i + 1][j] + 1
  end
end
max = 0
0.upto(h - 1) do |i|
  0.upto(w - 1) do |j|
    sum = l[i][j] + r[i][j] + u[i][j] + d[i][j]
    max = sum if max < sum
  end
end
puts max + 1
