H, W = map(int, input().split())
S = []
for i in range(H):
    S.append(input())
    
ans_W = [[-1 for i in range(W)] for j in range(H)]
for i in range(H):
    count = 0
    now = 0
    for j in range(W):
        if S[i][j] == ".":
            count += 1
        else:
            for k in range(now, min(W, now+1+count)):
                if k == j:
                    ans_W[i][k] = 0
                else:
                    ans_W[i][k] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(W, now+1+count)):
            ans_W[i][k] = count

ans_H = [[-1 for i in range(W)] for j in range(H)]
for i in range(W):
    count = 0
    now = 0
    for j in range(H):
        if S[j][i] == ".":
            count += 1
        else:
            for k in range(now, min(H, now+1+count)):
                if k == j:
                    ans_H[k][i] = 0
                else:
                    ans_H[k][i] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(H, now+1+count)):
            ans_H[k][i] = count

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, ans_H[i][j] + ans_W[i][j])
            
print(ans-1) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W S = [] S [] for i in range(H):
    S.append(input())
     i range(H) range H S.append(input()) S.append S append input() input [-1 for i in range(W)] for j in range(H) for j in range(H) j range(H) range H for j in range(H) [-1 for i in range(W)] ans_W = [[-1 for i in range(W)] for j in range(H)] ans_W [[-1 for i in range(W)] for j in range(H)] for i in range(H):
    count = 0
    now = 0
    for j in range(W):
        if S[i][j] == ".":
            count += 1
        else:
            for k in range(now, min(W, now+1+count)):
                if k == j:
                    ans_W[i][k] = 0
                else:
                    ans_W[i][k] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(W, now+1+count)):
            ans_W[i][k] = count i range(H) range H count = 0 count 0 now = 0 now 0 for j in range(W):
        if S[i][j] == ".":
            count += 1
        else:
            for k in range(now, min(W, now+1+count)):
                if k == j:
                    ans_W[i][k] = 0
                else:
                    ans_W[i][k] = count
            now += count+1
            count = 0
     j range(W) range W if S[i][j] == ".":
            count += 1
        else:
            for k in range(now, min(W, now+1+count)):
                if k == j:
                    ans_W[i][k] = 0
                else:
                    ans_W[i][k] = count
            now += count+1
            count = 0
     S[i][j] == "." S[i][j] [i] S i j "." count += 1 count 1 for k in range(now, min(W, now+1+count)):
                if k == j:
                    ans_W[i][k] = 0
                else:
                    ans_W[i][k] = count
             k range(now, min(W, now+1+count)) range now min(W, now+1+count) min W now+1+count now+1 now 1 count if k == j:
                    ans_W[i][k] = 0
                else:
                    ans_W[i][k] = count
             k == j k j ans_W[i][k] = 0 ans_W[i][k] [i] ans_W i k 0 ans_W[i][k] = count ans_W[i][k] [i] ans_W i k count now += count+1 now count+1 count 1 count = 0 count 0 if count != 0:
        for k in range(now, min(W, now+1+count)):
            ans_W[i][k] = count count != 0 count 0 for k in range(now, min(W, now+1+count)):
            ans_W[i][k] = count k range(now, min(W, now+1+count)) range now min(W, now+1+count) min W now+1+count now+1 now 1 count ans_W[i][k] = count ans_W[i][k] [i] ans_W i k count [-1 for i in range(W)] for j in range(H) for j in range(H) j range(H) range H for j in range(H) [-1 for i in range(W)] ans_H = [[-1 for i in range(W)] for j in range(H)] ans_H [[-1 for i in range(W)] for j in range(H)] for i in range(W):
    count = 0
    now = 0
    for j in range(H):
        if S[j][i] == ".":
            count += 1
        else:
            for k in range(now, min(H, now+1+count)):
                if k == j:
                    ans_H[k][i] = 0
                else:
                    ans_H[k][i] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(H, now+1+count)):
            ans_H[k][i] = count i range(W) range W count = 0 count 0 now = 0 now 0 for j in range(H):
        if S[j][i] == ".":
            count += 1
        else:
            for k in range(now, min(H, now+1+count)):
                if k == j:
                    ans_H[k][i] = 0
                else:
                    ans_H[k][i] = count
            now += count+1
            count = 0
     j range(H) range H if S[j][i] == ".":
            count += 1
        else:
            for k in range(now, min(H, now+1+count)):
                if k == j:
                    ans_H[k][i] = 0
                else:
                    ans_H[k][i] = count
            now += count+1
            count = 0
     S[j][i] == "." S[j][i] [j] S j i "." count += 1 count 1 for k in range(now, min(H, now+1+count)):
                if k == j:
                    ans_H[k][i] = 0
                else:
                    ans_H[k][i] = count
             k range(now, min(H, now+1+count)) range now min(H, now+1+count) min H now+1+count now+1 now 1 count if k == j:
                    ans_H[k][i] = 0
                else:
                    ans_H[k][i] = count
             k == j k j ans_H[k][i] = 0 ans_H[k][i] [k] ans_H k i 0 ans_H[k][i] = count ans_H[k][i] [k] ans_H k i count now += count+1 now count+1 count 1 count = 0 count 0 if count != 0:
        for k in range(now, min(H, now+1+count)):
            ans_H[k][i] = count count != 0 count 0 for k in range(now, min(H, now+1+count)):
            ans_H[k][i] = count k range(now, min(H, now+1+count)) range now min(H, now+1+count) min H now+1+count now+1 now 1 count ans_H[k][i] = count ans_H[k][i] [k] ans_H k i count ans = 0 ans 0 for i in range(H):
    for j in range(W):
        ans = max(ans, ans_H[i][j] + ans_W[i][j])
             i range(H) range H for j in range(W):
        ans = max(ans, ans_H[i][j] + ans_W[i][j])
             j range(W) range W ans = max(ans, ans_H[i][j] + ans_W[i][j]) ans max(ans, ans_H[i][j] + ans_W[i][j]) max ans ans_H[i][j] + ans_W[i][j] ans_H[i][j] [i] ans_H i j ans_W[i][j] [i] ans_W i j print(ans-1) print ans-1 ans 1 W = map(int, input().split()) map(int, input().split()) W now = 0 0 now ans = 0 0 ans count = 0 0 count now += count+1 count+1 now ans_W = [[-1 for i in range(W)] for j in range(H)] [[-1 for i in range(W)] for j in range(H)] ans_W count = 0 0 count S = [] [] S count += 1 1 count ans = max(ans, ans_H[i][j] + ans_W[i][j]) max(ans, ans_H[i][j] + ans_W[i][j]) ans count = 0 0 count ans_H = [[-1 for i in range(W)] for j in range(H)] [[-1 for i in range(W)] for j in range(H)] ans_H now += count+1 count+1 now now = 0 0 now count += 1 1 count count = 0 0 count H, W = map(int, input().split()) map(int, input().split()) H
H, W = map(int, input().split())
S = []
for i in range(H):
    S.append(input())
    
ans_W = [[-1 for i in range(W)] for j in range(H)]
for i in range(H):
    count = 0
    now = 0
    for j in range(W):
        if S[i][j] == ".":
            count += 1
        else:
            for k in range(now, min(W, now+1+count)):
                if k == j:
                    ans_W[i][k] = 0
                else:
                    ans_W[i][k] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(W, now+1+count)):
            ans_W[i][k] = count

ans_H = [[-1 for i in range(W)] for j in range(H)]
for i in range(W):
    count = 0
    now = 0
    for j in range(H):
        if S[j][i] == ".":
            count += 1
        else:
            for k in range(now, min(H, now+1+count)):
                if k == j:
                    ans_H[k][i] = 0
                else:
                    ans_H[k][i] = count
            now += count+1
            count = 0
    if count != 0:
        for k in range(now, min(H, now+1+count)):
            ans_H[k][i] = count

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, ans_H[i][j] + ans_W[i][j])
            
print(ans-1)
