import sys
import bisect


def input():
    return sys.stdin.readline().rstrip()


def main():
    H, W = map(int, input().split())
    S = [[] for _ in range(H)]
    count = [[0] * W for _ in range(H)]

    # read and horizontal
    for i in range(H):
        s = list(input())
        S[i] = s
        con = 0
        for j in range(W):
            if s[j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
            elif con > 0:
                count[i][j] = con

    pass
    # vertical
    for j in range(W):
        ##############
        con = 0
        for i in range(H):
            if S[i][j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
            elif con > 0:
                count[i][j] += con

    m = 0
    for i in range(H):
        m =max(m,max(count[i]))
    print(m-1)

if __name__ == "__main__":
    main() import sys sys import bisect bisect def input():
    return sys.stdin.readline().rstrip() input return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    H, W = map(int, input().split())
    S = [[] for _ in range(H)]
    count = [[0] * W for _ in range(H)]

    # read and horizontal
    for i in range(H):
        s = list(input())
        S[i] = s
        con = 0
        for j in range(W):
            if s[j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
            elif con > 0:
                count[i][j] = con

    pass
    # vertical
    for j in range(W):
        ##############
        con = 0
        for i in range(H):
            if S[i][j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
            elif con > 0:
                count[i][j] += con

    m = 0
    for i in range(H):
        m =max(m,max(count[i]))
    print(m-1) main H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W [] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [] S = [[] for _ in range(H)] S [[] for _ in range(H)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W count = [[0] * W for _ in range(H)] count [[0] * W for _ in range(H)] for i in range(H):
        s = list(input())
        S[i] = s
        con = 0
        for j in range(W):
            if s[j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
            elif con > 0:
                count[i][j] = con

     i range(H) range H s = list(input()) s list(input()) list input() input S[i] = s S[i] S i s con = 0 con 0 for j in range(W):
            if s[j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
            elif con > 0:
                count[i][j] = con

     j range(W) range W if s[j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
            elif con > 0:
                count[i][j] = con

     s[j] == "#" s[j] s j "#" con = 0 con 0 continue elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
             con == 0 con 0 con = 1 con 1 k = j + 1 k j + 1 j 1 while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                 k < W k W if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                 s[k] == "." s[k] s k "." con += 1 con 1 k += 1 k 1 break count[i][j] = con count[i][j] [i] count i j con elif con > 0:
                count[i][j] = con

     con > 0 con 0 count[i][j] = con count[i][j] [i] count i j con for j in range(W):
        ##############
        con = 0
        for i in range(H):
            if S[i][j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
            elif con > 0:
                count[i][j] += con

     j range(W) range W con = 0 con 0 for i in range(H):
            if S[i][j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
            elif con > 0:
                count[i][j] += con

     i range(H) range H if S[i][j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
            elif con > 0:
                count[i][j] += con

     S[i][j] == "#" S[i][j] [i] S i j "#" con = 0 con 0 continue elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
             con == 0 con 0 con = 1 con 1 k = i + 1 k i + 1 i 1 while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                 k < H k H if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                 S[k][j] == "." S[k][j] [k] S k j "." con += 1 con 1 k += 1 k 1 break count[i][j] += con count[i][j] [i] count i j con elif con > 0:
                count[i][j] += con

     con > 0 con 0 count[i][j] += con count[i][j] [i] count i j con m = 0 m 0 for i in range(H):
        m =max(m,max(count[i]))
     i range(H) range H m =max(m,max(count[i])) m max(m,max(count[i])) max m max(count[i]) max count[i] count i print(m-1) print m-1 m 1 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    H, W = map(int, input().split())
    S = [[] for _ in range(H)]
    count = [[0] * W for _ in range(H)]

    # read and horizontal
    for i in range(H):
        s = list(input())
        S[i] = s
        con = 0
        for j in range(W):
            if s[j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
            elif con > 0:
                count[i][j] = con

    pass
    # vertical
    for j in range(W):
        ##############
        con = 0
        for i in range(H):
            if S[i][j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
            elif con > 0:
                count[i][j] += con

    m = 0
    for i in range(H):
        m =max(m,max(count[i]))
    print(m-1) def main():
    H, W = map(int, input().split())
    S = [[] for _ in range(H)]
    count = [[0] * W for _ in range(H)]

    # read and horizontal
    for i in range(H):
        s = list(input())
        S[i] = s
        con = 0
        for j in range(W):
            if s[j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
            elif con > 0:
                count[i][j] = con

    pass
    # vertical
    for j in range(W):
        ##############
        con = 0
        for i in range(H):
            if S[i][j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
            elif con > 0:
                count[i][j] += con

    m = 0
    for i in range(H):
        m =max(m,max(count[i]))
    print(m-1) main def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input
import sys
import bisect


def input():
    return sys.stdin.readline().rstrip()


def main():
    H, W = map(int, input().split())
    S = [[] for _ in range(H)]
    count = [[0] * W for _ in range(H)]

    # read and horizontal
    for i in range(H):
        s = list(input())
        S[i] = s
        con = 0
        for j in range(W):
            if s[j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = j + 1
                while k < W:
                    if s[k] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] = con
            elif con > 0:
                count[i][j] = con

    pass
    # vertical
    for j in range(W):
        ##############
        con = 0
        for i in range(H):
            if S[i][j] == "#":
                con = 0
                continue
            elif con == 0:
                con = 1
                k = i + 1
                while k < H:
                    if S[k][j] == ".":
                        con += 1
                        k += 1
                    else:
                        break
                count[i][j] += con
            elif con > 0:
                count[i][j] += con

    m = 0
    for i in range(H):
        m =max(m,max(count[i]))
    print(m-1)

if __name__ == "__main__":
    main()
