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

    count_h = [[0] * W for _ in range(H)]
    count_w = [[0] * W for _ in range(H)]

    tmp_cnt_h = [0] * W
    for i in range(H):
        w_cnt = 0
        for j,c in enumerate(S[i]):
            if c == '.':
                tmp_cnt_h[j] += 1
                w_cnt += 1
            else:
                count_w[i][j-w_cnt:j] = [w_cnt]*w_cnt
                w_cnt = 0

                h_cnt = tmp_cnt_h[j]
                for x in range(i-h_cnt,i):
                    count_h[x][j] = h_cnt
                tmp_cnt_h[j] = 0

        count_w[i][W-w_cnt:W] = [w_cnt]*w_cnt

    for i, h_cnt in enumerate(tmp_cnt_h):
        for x in range(H-h_cnt,H):
            count_h[x][i] = h_cnt

    max_light = 0
    for i in range(H):
        for j in range(W):
            max_light = max(max_light, count_h[i][j] + count_w[i][j])
    print(max_light-1)

if __name__ == "__main__":
    main() def main():
    H,W = list(map(int, input().split()))
    S = [input() for _ in range(H)]

    count_h = [[0] * W for _ in range(H)]
    count_w = [[0] * W for _ in range(H)]

    tmp_cnt_h = [0] * W
    for i in range(H):
        w_cnt = 0
        for j,c in enumerate(S[i]):
            if c == '.':
                tmp_cnt_h[j] += 1
                w_cnt += 1
            else:
                count_w[i][j-w_cnt:j] = [w_cnt]*w_cnt
                w_cnt = 0

                h_cnt = tmp_cnt_h[j]
                for x in range(i-h_cnt,i):
                    count_h[x][j] = h_cnt
                tmp_cnt_h[j] = 0

        count_w[i][W-w_cnt:W] = [w_cnt]*w_cnt

    for i, h_cnt in enumerate(tmp_cnt_h):
        for x in range(H-h_cnt,H):
            count_h[x][i] = h_cnt

    max_light = 0
    for i in range(H):
        for j in range(W):
            max_light = max(max_light, count_h[i][j] + count_w[i][j])
    print(max_light-1) main H,W = list(map(int, input().split())) H list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split W input() for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) input() input S = [input() for _ in range(H)] S [input() 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_h = [[0] * W for _ in range(H)] count_h [[0] * W 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_w = [[0] * W for _ in range(H)] count_w [[0] * W for _ in range(H)] tmp_cnt_h = [0] * W tmp_cnt_h [0] * W [0] 0 W for i in range(H):
        w_cnt = 0
        for j,c in enumerate(S[i]):
            if c == '.':
                tmp_cnt_h[j] += 1
                w_cnt += 1
            else:
                count_w[i][j-w_cnt:j] = [w_cnt]*w_cnt
                w_cnt = 0

                h_cnt = tmp_cnt_h[j]
                for x in range(i-h_cnt,i):
                    count_h[x][j] = h_cnt
                tmp_cnt_h[j] = 0

        count_w[i][W-w_cnt:W] = [w_cnt]*w_cnt

     i range(H) range H w_cnt = 0 w_cnt 0 for j,c in enumerate(S[i]):
            if c == '.':
                tmp_cnt_h[j] += 1
                w_cnt += 1
            else:
                count_w[i][j-w_cnt:j] = [w_cnt]*w_cnt
                w_cnt = 0

                h_cnt = tmp_cnt_h[j]
                for x in range(i-h_cnt,i):
                    count_h[x][j] = h_cnt
                tmp_cnt_h[j] = 0

         j c enumerate(S[i]) enumerate S[i] S i if c == '.':
                tmp_cnt_h[j] += 1
                w_cnt += 1
            else:
                count_w[i][j-w_cnt:j] = [w_cnt]*w_cnt
                w_cnt = 0

                h_cnt = tmp_cnt_h[j]
                for x in range(i-h_cnt,i):
                    count_h[x][j] = h_cnt
                tmp_cnt_h[j] = 0

         c == '.' c '.' tmp_cnt_h[j] += 1 tmp_cnt_h[j] tmp_cnt_h j 1 w_cnt += 1 w_cnt 1 count_w[i][j-w_cnt:j] = [w_cnt]*w_cnt count_w[i][j-w_cnt:j] [i] count_w i j-w_cnt:j j-w_cnt j w_cnt j [w_cnt]*w_cnt [w_cnt] w_cnt w_cnt w_cnt = 0 w_cnt 0 h_cnt = tmp_cnt_h[j] h_cnt tmp_cnt_h[j] tmp_cnt_h j for x in range(i-h_cnt,i):
                    count_h[x][j] = h_cnt
                 x range(i-h_cnt,i) range i-h_cnt i h_cnt i count_h[x][j] = h_cnt count_h[x][j] [x] count_h x j h_cnt tmp_cnt_h[j] = 0 tmp_cnt_h[j] tmp_cnt_h j 0 count_w[i][W-w_cnt:W] = [w_cnt]*w_cnt count_w[i][W-w_cnt:W] [i] count_w i W-w_cnt:W W-w_cnt W w_cnt W [w_cnt]*w_cnt [w_cnt] w_cnt w_cnt for i, h_cnt in enumerate(tmp_cnt_h):
        for x in range(H-h_cnt,H):
            count_h[x][i] = h_cnt

     i h_cnt enumerate(tmp_cnt_h) enumerate tmp_cnt_h for x in range(H-h_cnt,H):
            count_h[x][i] = h_cnt

     x range(H-h_cnt,H) range H-h_cnt H h_cnt H count_h[x][i] = h_cnt count_h[x][i] [x] count_h x i h_cnt max_light = 0 max_light 0 for i in range(H):
        for j in range(W):
            max_light = max(max_light, count_h[i][j] + count_w[i][j])
     i range(H) range H for j in range(W):
            max_light = max(max_light, count_h[i][j] + count_w[i][j])
     j range(W) range W max_light = max(max_light, count_h[i][j] + count_w[i][j]) max_light max(max_light, count_h[i][j] + count_w[i][j]) max max_light count_h[i][j] + count_w[i][j] count_h[i][j] [i] count_h i j count_w[i][j] [i] count_w i j print(max_light-1) print max_light-1 max_light 1 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    H,W = list(map(int, input().split()))
    S = [input() for _ in range(H)]

    count_h = [[0] * W for _ in range(H)]
    count_w = [[0] * W for _ in range(H)]

    tmp_cnt_h = [0] * W
    for i in range(H):
        w_cnt = 0
        for j,c in enumerate(S[i]):
            if c == '.':
                tmp_cnt_h[j] += 1
                w_cnt += 1
            else:
                count_w[i][j-w_cnt:j] = [w_cnt]*w_cnt
                w_cnt = 0

                h_cnt = tmp_cnt_h[j]
                for x in range(i-h_cnt,i):
                    count_h[x][j] = h_cnt
                tmp_cnt_h[j] = 0

        count_w[i][W-w_cnt:W] = [w_cnt]*w_cnt

    for i, h_cnt in enumerate(tmp_cnt_h):
        for x in range(H-h_cnt,H):
            count_h[x][i] = h_cnt

    max_light = 0
    for i in range(H):
        for j in range(W):
            max_light = max(max_light, count_h[i][j] + count_w[i][j])
    print(max_light-1) def main():
    H,W = list(map(int, input().split()))
    S = [input() for _ in range(H)]

    count_h = [[0] * W for _ in range(H)]
    count_w = [[0] * W for _ in range(H)]

    tmp_cnt_h = [0] * W
    for i in range(H):
        w_cnt = 0
        for j,c in enumerate(S[i]):
            if c == '.':
                tmp_cnt_h[j] += 1
                w_cnt += 1
            else:
                count_w[i][j-w_cnt:j] = [w_cnt]*w_cnt
                w_cnt = 0

                h_cnt = tmp_cnt_h[j]
                for x in range(i-h_cnt,i):
                    count_h[x][j] = h_cnt
                tmp_cnt_h[j] = 0

        count_w[i][W-w_cnt:W] = [w_cnt]*w_cnt

    for i, h_cnt in enumerate(tmp_cnt_h):
        for x in range(H-h_cnt,H):
            count_h[x][i] = h_cnt

    max_light = 0
    for i in range(H):
        for j in range(W):
            max_light = max(max_light, count_h[i][j] + count_w[i][j])
    print(max_light-1) main

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

    count_h = [[0] * W for _ in range(H)]
    count_w = [[0] * W for _ in range(H)]

    tmp_cnt_h = [0] * W
    for i in range(H):
        w_cnt = 0
        for j,c in enumerate(S[i]):
            if c == '.':
                tmp_cnt_h[j] += 1
                w_cnt += 1
            else:
                count_w[i][j-w_cnt:j] = [w_cnt]*w_cnt
                w_cnt = 0

                h_cnt = tmp_cnt_h[j]
                for x in range(i-h_cnt,i):
                    count_h[x][j] = h_cnt
                tmp_cnt_h[j] = 0

        count_w[i][W-w_cnt:W] = [w_cnt]*w_cnt

    for i, h_cnt in enumerate(tmp_cnt_h):
        for x in range(H-h_cnt,H):
            count_h[x][i] = h_cnt

    max_light = 0
    for i in range(H):
        for j in range(W):
            max_light = max(max_light, count_h[i][j] + count_w[i][j])
    print(max_light-1)

if __name__ == "__main__":
    main()