from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    h, w = map(int, input().split())
    col = [[0, w + 1] for _ in range(h)]
    row = [[0, h + 1] for _ in range(w)]
    for i in range(h):
        s = list(input()[:-1].decode())
        for j in range(w):
            if s[j] == '#':
                col[i].append(j + 1)
                row[j].append(i + 1)

    cc = [[0] * (w + 2) for _ in range(h)]
    rc = [[0] * (h + 2) for _ in range(w)]

    for i in range(h):
        col[i].sort()
        for j in range(len(col[i]) - 1):
            cc[i][col[i][j] + 1:col[i][j + 1]] = [col[i][j + 1] - col[i][j] - 1] * (col[i][j + 1] - col[i][j] - 1)

    for i in range(w):
        row[i].sort()
        for j in range(len(row[i]) - 1):
            rc[i][row[i][j] + 1:row[i][j + 1]] = [row[i][j + 1] - row[i][j] - 1] * (row[i][j + 1] - row[i][j] - 1)

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, cc[i][j + 1] + rc[j][i + 1] - 1)

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main() from sys import stdin, setrecursionlimit def main():
    input = stdin.buffer.readline
    h, w = map(int, input().split())
    col = [[0, w + 1] for _ in range(h)]
    row = [[0, h + 1] for _ in range(w)]
    for i in range(h):
        s = list(input()[:-1].decode())
        for j in range(w):
            if s[j] == '#':
                col[i].append(j + 1)
                row[j].append(i + 1)

    cc = [[0] * (w + 2) for _ in range(h)]
    rc = [[0] * (h + 2) for _ in range(w)]

    for i in range(h):
        col[i].sort()
        for j in range(len(col[i]) - 1):
            cc[i][col[i][j] + 1:col[i][j + 1]] = [col[i][j + 1] - col[i][j] - 1] * (col[i][j + 1] - col[i][j] - 1)

    for i in range(w):
        row[i].sort()
        for j in range(len(row[i]) - 1):
            rc[i][row[i][j] + 1:row[i][j + 1]] = [row[i][j + 1] - row[i][j] - 1] * (row[i][j + 1] - row[i][j] - 1)

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, cc[i][j + 1] + rc[j][i + 1] - 1)

    print(ans) main input = stdin.buffer.readline input stdin.buffer.readline stdin.buffer stdin buffer readline h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w [0, w + 1] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0, w + 1] 0 w + 1 w 1 col = [[0, w + 1] for _ in range(h)] col [[0, w + 1] for _ in range(h)] [0, h + 1] for _ in range(w) for _ in range(w) _ range(w) range w for _ in range(w) [0, h + 1] 0 h + 1 h 1 row = [[0, h + 1] for _ in range(w)] row [[0, h + 1] for _ in range(w)] for i in range(h):
        s = list(input()[:-1].decode())
        for j in range(w):
            if s[j] == '#':
                col[i].append(j + 1)
                row[j].append(i + 1)

     i range(h) range h s = list(input()[:-1].decode()) s list(input()[:-1].decode()) list input()[:-1].decode() [:-1].decode [:-1] () input :-1 -1 decode for j in range(w):
            if s[j] == '#':
                col[i].append(j + 1)
                row[j].append(i + 1)

     j range(w) range w if s[j] == '#':
                col[i].append(j + 1)
                row[j].append(i + 1)

     s[j] == '#' s[j] s j '#' col[i].append(j + 1) [i].append [i] col i append j + 1 j 1 row[j].append(i + 1) [j].append [j] row j append i + 1 i 1 [0] * (w + 2) for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0] * (w + 2) [0] 0 w + 2 w 2 cc = [[0] * (w + 2) for _ in range(h)] cc [[0] * (w + 2) for _ in range(h)] [0] * (h + 2) for _ in range(w) for _ in range(w) _ range(w) range w for _ in range(w) [0] * (h + 2) [0] 0 h + 2 h 2 rc = [[0] * (h + 2) for _ in range(w)] rc [[0] * (h + 2) for _ in range(w)] for i in range(h):
        col[i].sort()
        for j in range(len(col[i]) - 1):
            cc[i][col[i][j] + 1:col[i][j + 1]] = [col[i][j + 1] - col[i][j] - 1] * (col[i][j + 1] - col[i][j] - 1)

     i range(h) range h col[i].sort() [i].sort [i] col i sort for j in range(len(col[i]) - 1):
            cc[i][col[i][j] + 1:col[i][j + 1]] = [col[i][j + 1] - col[i][j] - 1] * (col[i][j + 1] - col[i][j] - 1)

     j range(len(col[i]) - 1) range len(col[i]) - 1 len(col[i]) len col[i] col i 1 cc[i][col[i][j] + 1:col[i][j + 1]] = [col[i][j + 1] - col[i][j] - 1] * (col[i][j + 1] - col[i][j] - 1) cc[i][col[i][j] + 1:col[i][j + 1]] [i] cc i col[i][j] + 1:col[i][j + 1] col[i][j] + 1 col[i][j] [i] col i j 1 col[i][j + 1] [i] col i j + 1 j 1 [col[i][j + 1] - col[i][j] - 1] * (col[i][j + 1] - col[i][j] - 1) [col[i][j + 1] - col[i][j] - 1] col[i][j + 1] - col[i][j] - 1 col[i][j + 1] - col[i][j] col[i][j + 1] [i] col i j + 1 j 1 col[i][j] [i] col i j 1 col[i][j + 1] - col[i][j] - 1 col[i][j + 1] - col[i][j] col[i][j + 1] [i] col i j + 1 j 1 col[i][j] [i] col i j 1 for i in range(w):
        row[i].sort()
        for j in range(len(row[i]) - 1):
            rc[i][row[i][j] + 1:row[i][j + 1]] = [row[i][j + 1] - row[i][j] - 1] * (row[i][j + 1] - row[i][j] - 1)

     i range(w) range w row[i].sort() [i].sort [i] row i sort for j in range(len(row[i]) - 1):
            rc[i][row[i][j] + 1:row[i][j + 1]] = [row[i][j + 1] - row[i][j] - 1] * (row[i][j + 1] - row[i][j] - 1)

     j range(len(row[i]) - 1) range len(row[i]) - 1 len(row[i]) len row[i] row i 1 rc[i][row[i][j] + 1:row[i][j + 1]] = [row[i][j + 1] - row[i][j] - 1] * (row[i][j + 1] - row[i][j] - 1) rc[i][row[i][j] + 1:row[i][j + 1]] [i] rc i row[i][j] + 1:row[i][j + 1] row[i][j] + 1 row[i][j] [i] row i j 1 row[i][j + 1] [i] row i j + 1 j 1 [row[i][j + 1] - row[i][j] - 1] * (row[i][j + 1] - row[i][j] - 1) [row[i][j + 1] - row[i][j] - 1] row[i][j + 1] - row[i][j] - 1 row[i][j + 1] - row[i][j] row[i][j + 1] [i] row i j + 1 j 1 row[i][j] [i] row i j 1 row[i][j + 1] - row[i][j] - 1 row[i][j + 1] - row[i][j] row[i][j + 1] [i] row i j + 1 j 1 row[i][j] [i] row i j 1 ans = 0 ans 0 for i in range(h):
        for j in range(w):
            ans = max(ans, cc[i][j + 1] + rc[j][i + 1] - 1)

     i range(h) range h for j in range(w):
            ans = max(ans, cc[i][j + 1] + rc[j][i + 1] - 1)

     j range(w) range w ans = max(ans, cc[i][j + 1] + rc[j][i + 1] - 1) ans max(ans, cc[i][j + 1] + rc[j][i + 1] - 1) max ans cc[i][j + 1] + rc[j][i + 1] - 1 cc[i][j + 1] + rc[j][i + 1] cc[i][j + 1] [i] cc i j + 1 j 1 rc[j][i + 1] [j] rc j i + 1 i 1 1 print(ans) print ans if __name__ == "__main__":
    setrecursionlimit(10000)
    main() __name__ == "__main__" __name__ "__main__" setrecursionlimit(10000) setrecursionlimit 10000 main() main def main():
    input = stdin.buffer.readline
    h, w = map(int, input().split())
    col = [[0, w + 1] for _ in range(h)]
    row = [[0, h + 1] for _ in range(w)]
    for i in range(h):
        s = list(input()[:-1].decode())
        for j in range(w):
            if s[j] == '#':
                col[i].append(j + 1)
                row[j].append(i + 1)

    cc = [[0] * (w + 2) for _ in range(h)]
    rc = [[0] * (h + 2) for _ in range(w)]

    for i in range(h):
        col[i].sort()
        for j in range(len(col[i]) - 1):
            cc[i][col[i][j] + 1:col[i][j + 1]] = [col[i][j + 1] - col[i][j] - 1] * (col[i][j + 1] - col[i][j] - 1)

    for i in range(w):
        row[i].sort()
        for j in range(len(row[i]) - 1):
            rc[i][row[i][j] + 1:row[i][j + 1]] = [row[i][j + 1] - row[i][j] - 1] * (row[i][j + 1] - row[i][j] - 1)

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, cc[i][j + 1] + rc[j][i + 1] - 1)

    print(ans) def main():
    input = stdin.buffer.readline
    h, w = map(int, input().split())
    col = [[0, w + 1] for _ in range(h)]
    row = [[0, h + 1] for _ in range(w)]
    for i in range(h):
        s = list(input()[:-1].decode())
        for j in range(w):
            if s[j] == '#':
                col[i].append(j + 1)
                row[j].append(i + 1)

    cc = [[0] * (w + 2) for _ in range(h)]
    rc = [[0] * (h + 2) for _ in range(w)]

    for i in range(h):
        col[i].sort()
        for j in range(len(col[i]) - 1):
            cc[i][col[i][j] + 1:col[i][j + 1]] = [col[i][j + 1] - col[i][j] - 1] * (col[i][j + 1] - col[i][j] - 1)

    for i in range(w):
        row[i].sort()
        for j in range(len(row[i]) - 1):
            rc[i][row[i][j] + 1:row[i][j + 1]] = [row[i][j + 1] - row[i][j] - 1] * (row[i][j + 1] - row[i][j] - 1)

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, cc[i][j + 1] + rc[j][i + 1] - 1)

    print(ans) main
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    h, w = map(int, input().split())
    col = [[0, w + 1] for _ in range(h)]
    row = [[0, h + 1] for _ in range(w)]
    for i in range(h):
        s = list(input()[:-1].decode())
        for j in range(w):
            if s[j] == '#':
                col[i].append(j + 1)
                row[j].append(i + 1)

    cc = [[0] * (w + 2) for _ in range(h)]
    rc = [[0] * (h + 2) for _ in range(w)]

    for i in range(h):
        col[i].sort()
        for j in range(len(col[i]) - 1):
            cc[i][col[i][j] + 1:col[i][j + 1]] = [col[i][j + 1] - col[i][j] - 1] * (col[i][j + 1] - col[i][j] - 1)

    for i in range(w):
        row[i].sort()
        for j in range(len(row[i]) - 1):
            rc[i][row[i][j] + 1:row[i][j + 1]] = [row[i][j + 1] - row[i][j] - 1] * (row[i][j + 1] - row[i][j] - 1)

    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, cc[i][j + 1] + rc[j][i + 1] - 1)

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
