using System;
using System.Linq;

namespace ABC
{
    using System.Collections.Generic;
#if USE_STUB
    using static Stub.Console;
#else
    using static System.Console;
#endif
    using static System.Math;
    public class Program
    {
        private const int MOD = 1000000007;

        static long H;
        static long W;
        static char[][] S;

        static void Main(string[] args)
        {
            WriteLine(Solve());
        }

        public static object Solve()
        {
            var hw = ReadLine().Split().Select(int.Parse).ToArray();
            H = hw[0];
            W = hw[1];
            S = new char[H][];
            for (int i = 0; i < H; i++)
            {
                S[i] = ReadLine().ToCharArray();
            }

            var points = new Dictionary<int, int>();
            for (int h = 0; h < H; h++)
            {
                var l = new List<int>();
                for (int w = 0; w < W; w++)
                {
                    if (S[h][w] == '.')
                        l.Add((h << 16) + w);
                    else
                    {
                        foreach (var item in l)
                        {
                            if (!points.ContainsKey(item))
                                points.Add(item, l.Count);
                            else
                                points[item] += l.Count - 1;
                        }
                        l.Clear();
                    }
                }
                foreach (var item in l)
                {
                    if (!points.ContainsKey(item))
                        points.Add(item, l.Count);
                    else
                        points[item] += l.Count - 1;
                }
                l.Clear();
            }
            for (int w = 0; w < W; w++)
            {
                var l = new List<int>();
                for (int h = 0; h < H; h++)
                {
                    if (S[h][w] == '.')
                        l.Add((h << 16) + w);
                    else
                    {
                        foreach (var item in l)
                        {
                            if (!points.ContainsKey(item))
                                points.Add(item, l.Count);
                            else
                                points[item] += l.Count - 1;
                        }
                        l.Clear();
                    }
                }

                foreach (var item in l)
                {
                    if (!points.ContainsKey(item))
                        points.Add(item, l.Count);
                    else
                        points[item] += l.Count - 1;
                }
                l.Clear();
            }

            return points.Values.Max();
        }

        private static void Validate(Dictionary<int, int> points, int i, int j, List<int> l)
        {
            if (S[i][j] == '.')
            {
                l.Add(i << 16 + j);
            }
            else
            {
                CountUp(points, l);
            }
        }

        private static void CountUp(Dictionary<int, int> points, List<int> l)
        {
            foreach (var item in l)
            {
                if (!points.ContainsKey(item))
                    points.Add(item, l.Count);
                else
                    points[item] += l.Count - 1;
            }
            l.Clear();
        }
    }
}


Measured memory_bytes: 168196