using System;
using System.Collections.Generic;

namespace ConsoleApplication1
{
    class Program
    {
        static int r = 0, c = 0;
        static List<string> mem = new List<string>();

        static Point[,] map = new Point[2000 + 5, 2000 + 5];
        private static void Main(string[] args)
        {
            string[] strings = Console.ReadLine().Split(' ');
            r = Convert.ToInt32(strings[0]);
            c = Convert.ToInt32(strings[1]);

            //set
            for (int i = 0; i < r; ++i)
            {
                for (int j = 0; j < c; ++j)
                {
                    map[i, j] = new Point(0, 0);
                }
            }

            for (int i = 0; i < r; ++i)
            {
                mem.Add(Console.ReadLine());
            }

            //get width
            for (int i = 0; i < r; ++i)
            {
                List<Position> positions = new List<Position>();
                int count = 0;
                for (int j = 0; j < c; ++j)
                {
                    if (mem[i][j] == '.')
                    {
                        positions.Add(new Position(i, j));
                        ++count;
                    }
                    else if (mem[i][j] == '#')
                    {
                        foreach (Position pos in positions)
                        {
                            map[pos.X, pos.Y].Width = count;
                        }
                        positions = new List<Position>();
                        count = 0;
                    }
                }
                foreach (Position pos in positions)
                {
                    map[pos.X, pos.Y].Width = count;
                }
            }

            //get height
            for (int i = 0; i < c; ++i)
            {
                List<Position> positions = new List<Position>();
                int count = 0;
                for (int j = 0; j < r; ++j)
                {
                    if (mem[j][i] == '.')
                    {
                        positions.Add(new Position(j, i));
                        ++count;
                    }
                    else if (mem[j][i] == '#')
                    {
                        foreach (Position pos in positions)
                        {
                            map[pos.X, pos.Y].Height = count;
                        }
                        positions = new List<Position>();
                        count = 0;
                    }
                }
                foreach (Position pos in positions)
                {
                    map[pos.X, pos.Y].Height = count;
                }
            }

            int result = 0;
            for (int i = 0; i < r; ++i)
            {
                for (int j = 0; j < c; ++j)
                {
                    result = Math.Max(result, map[i, j].LightSquare);
                }
            }
            Console.WriteLine(result);
        }
    }
    public class Position
    {
        public int X { get; set; }
        public int Y { get; set; }
        public Position(int x, int y)
        {
            X = x;
            Y = y;
        }
    }

    public class Point
    {
        public int Height { get; set; }
        public int Width { get; set; }
        public Point(int h, int w)
        {
            Height = h;
            Width = w;
        }
        public int LightSquare
        {
            get
            {
                return Height + Width - 1;
            }
        }
    }
}

Measured memory_bytes: 207976