h,w = map(int,input().split())
S = [input() for _ in range(h)]
C = [[0 for _ in range(w)] for _ in range(h)]
for i in range(h):
    new = []
    flag = False
    cnt = 0
    for j in range(w):
        if flag:
            if S[i][j] == "#":
                for k in new:
                    C[i][k] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(j)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(j)
    else:
        if flag:
            for k in new:
                C[i][k] += cnt
            cnt = 0
            flag = False
for j in range(w):
    new = []
    flag = False
    cnt = 0
    for i in range(h):
        if flag:
            if S[i][j] == "#":
                for k in new:
                    C[k][j] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(i)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(i)
    else:
        if flag:
            for k in new:
                C[k][j] += cnt
            cnt = 0
            flag = False
ans = -1
for i in range(h):
    ans = max(ans,max(C[i]))
print(ans-1) h,w = map(int,input().split()) h 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 for _ in range(w)] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0 for _ in range(w)] C = [[0 for _ in range(w)] for _ in range(h)] C [[0 for _ in range(w)] for _ in range(h)] for i in range(h):
    new = []
    flag = False
    cnt = 0
    for j in range(w):
        if flag:
            if S[i][j] == "#":
                for k in new:
                    C[i][k] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(j)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(j)
    else:
        if flag:
            for k in new:
                C[i][k] += cnt
            cnt = 0
            flag = False i range(h) range h new = [] new [] flag = False flag False cnt = 0 cnt 0 for j in range(w):
        if flag:
            if S[i][j] == "#":
                for k in new:
                    C[i][k] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(j)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(j)
    else:
        if flag:
            for k in new:
                C[i][k] += cnt
            cnt = 0
            flag = False j range(w) range w if flag:
            if S[i][j] == "#":
                for k in new:
                    C[i][k] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(j)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(j)
     flag if S[i][j] == "#":
                for k in new:
                    C[i][k] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(j)
         S[i][j] == "#" S[i][j] [i] S i j "#" for k in new:
                    C[i][k] += cnt
                 k new C[i][k] += cnt C[i][k] [i] C i k cnt cnt = 0 cnt 0 new = [] new [] flag = False flag False cnt += 1 cnt 1 new.append(j) new.append new append j if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(j)
     S[i][j] == "." S[i][j] [i] S i j "." cnt = 1 cnt 1 flag = True flag True new.append(j) new.append new append j if flag:
            for k in new:
                C[i][k] += cnt
            cnt = 0
            flag = False flag for k in new:
                C[i][k] += cnt
             k new C[i][k] += cnt C[i][k] [i] C i k cnt cnt = 0 cnt 0 flag = False flag False for j in range(w):
    new = []
    flag = False
    cnt = 0
    for i in range(h):
        if flag:
            if S[i][j] == "#":
                for k in new:
                    C[k][j] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(i)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(i)
    else:
        if flag:
            for k in new:
                C[k][j] += cnt
            cnt = 0
            flag = False j range(w) range w new = [] new [] flag = False flag False cnt = 0 cnt 0 for i in range(h):
        if flag:
            if S[i][j] == "#":
                for k in new:
                    C[k][j] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(i)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(i)
    else:
        if flag:
            for k in new:
                C[k][j] += cnt
            cnt = 0
            flag = False i range(h) range h if flag:
            if S[i][j] == "#":
                for k in new:
                    C[k][j] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(i)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(i)
     flag if S[i][j] == "#":
                for k in new:
                    C[k][j] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(i)
         S[i][j] == "#" S[i][j] [i] S i j "#" for k in new:
                    C[k][j] += cnt
                 k new C[k][j] += cnt C[k][j] [k] C k j cnt cnt = 0 cnt 0 new = [] new [] flag = False flag False cnt += 1 cnt 1 new.append(i) new.append new append i if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(i)
     S[i][j] == "." S[i][j] [i] S i j "." cnt = 1 cnt 1 flag = True flag True new.append(i) new.append new append i if flag:
            for k in new:
                C[k][j] += cnt
            cnt = 0
            flag = False flag for k in new:
                C[k][j] += cnt
             k new C[k][j] += cnt C[k][j] [k] C k j cnt cnt = 0 cnt 0 flag = False flag False ans = -1 ans -1 for i in range(h):
    ans = max(ans,max(C[i])) i range(h) range h ans = max(ans,max(C[i])) ans max(ans,max(C[i])) max ans max(C[i]) max C[i] C i print(ans-1) print ans-1 ans 1 new = [] [] new cnt = 0 0 cnt flag = False False flag flag = False False flag flag = True True flag new = [] [] new flag = True True flag cnt += 1 1 cnt new = [] [] new h,w = map(int,input().split()) map(int,input().split()) h flag = False False flag S = [input() for _ in range(h)] [input() for _ in range(h)] S cnt = 0 0 cnt cnt = 0 0 cnt w = map(int,input().split()) map(int,input().split()) w new = [] [] new flag = False False flag cnt = 0 0 cnt cnt = 0 0 cnt ans = -1 -1 ans cnt = 0 0 cnt cnt = 1 1 cnt cnt = 1 1 cnt C = [[0 for _ in range(w)] for _ in range(h)] [[0 for _ in range(w)] for _ in range(h)] C cnt += 1 1 cnt ans = max(ans,max(C[i])) max(ans,max(C[i])) ans flag = False False flag flag = False False flag
h,w = map(int,input().split())
S = [input() for _ in range(h)]
C = [[0 for _ in range(w)] for _ in range(h)]
for i in range(h):
    new = []
    flag = False
    cnt = 0
    for j in range(w):
        if flag:
            if S[i][j] == "#":
                for k in new:
                    C[i][k] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(j)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(j)
    else:
        if flag:
            for k in new:
                C[i][k] += cnt
            cnt = 0
            flag = False
for j in range(w):
    new = []
    flag = False
    cnt = 0
    for i in range(h):
        if flag:
            if S[i][j] == "#":
                for k in new:
                    C[k][j] += cnt
                cnt = 0
                new = []
                flag = False
            else:
                cnt += 1
                new.append(i)
        else:
            if S[i][j] == ".":
                cnt = 1
                flag = True
                new.append(i)
    else:
        if flag:
            for k in new:
                C[k][j] += cnt
            cnt = 0
            flag = False
ans = -1
for i in range(h):
    ans = max(ans,max(C[i]))
print(ans-1)