h, w = map(int, input().split())
S = [["#"] * (w + 2)]
for i in range(h):
    S.append(["#"] + list(input()) + ["#"])
S.append(["#"] * (w + 2))
Lamp_row = [[0 for i in range(w+2)] for j in range(h+2)]
Lamp_col = [[0 for i in range(w+2)] for j in range(h+2)]
#print(S)

for row in range(h + 2):
    counter = 0
    for col1 in range(w + 1):
        col2 = col1 + 1
        if S[row][col1] == "#" and S[row][col2] == ".":
            start = col2
            counter += 1
        if S[row][col1] == "." and S[row][col2] == ".":
            counter += 1
        if S[row][col1] == "." and S[row][col2] == "#":
            end = col2
            for i in range(start, end):
                Lamp_row[row][i] = counter
            counter = 0
#print(*Lamp_row, sep="\n")
#print()

for col in range(w + 2):
    counter = 0
    for row1 in range(h + 1):
        row2 = row1 + 1
        if S[row1][col] == "#" and S[row2][col] == ".":
            start = row2
            counter += 1
        if S[row1][col] == "." and S[row2][col] == ".":
            counter += 1
        if S[row1][col] == "." and S[row2][col] == "#":
            end = row2
            for i in range(start, end):
                Lamp_col[i][col] = counter
            counter = 0
#print(*Lamp_col, sep="\n")

max_sum = 0
for row in range(h+2):
    for col in range(w+2):
        max_sum = max(max_sum, Lamp_row[row][col] + Lamp_col[row][col] - 1)
print(max_sum) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w S = [["#"] * (w + 2)] S [["#"] * (w + 2)] ["#"] * (w + 2) ["#"] "#" w + 2 w 2 for i in range(h):
    S.append(["#"] + list(input()) + ["#"]) i range(h) range h S.append(["#"] + list(input()) + ["#"]) S.append S append ["#"] + list(input()) + ["#"] ["#"] + list(input()) ["#"] "#" list(input()) list input() input ["#"] "#" S.append(["#"] * (w + 2)) S.append S append ["#"] * (w + 2) ["#"] "#" w + 2 w 2 [0 for i in range(w+2)] for j in range(h+2) for j in range(h+2) j range(h+2) range h+2 h 2 for j in range(h+2) [0 for i in range(w+2)] Lamp_row = [[0 for i in range(w+2)] for j in range(h+2)] Lamp_row [[0 for i in range(w+2)] for j in range(h+2)] [0 for i in range(w+2)] for j in range(h+2) for j in range(h+2) j range(h+2) range h+2 h 2 for j in range(h+2) [0 for i in range(w+2)] Lamp_col = [[0 for i in range(w+2)] for j in range(h+2)] Lamp_col [[0 for i in range(w+2)] for j in range(h+2)] for row in range(h + 2):
    counter = 0
    for col1 in range(w + 1):
        col2 = col1 + 1
        if S[row][col1] == "#" and S[row][col2] == ".":
            start = col2
            counter += 1
        if S[row][col1] == "." and S[row][col2] == ".":
            counter += 1
        if S[row][col1] == "." and S[row][col2] == "#":
            end = col2
            for i in range(start, end):
                Lamp_row[row][i] = counter
            counter = 0
#print(*Lamp_row, sep="\n")
#print() row range(h + 2) range h + 2 h 2 counter = 0 counter 0 for col1 in range(w + 1):
        col2 = col1 + 1
        if S[row][col1] == "#" and S[row][col2] == ".":
            start = col2
            counter += 1
        if S[row][col1] == "." and S[row][col2] == ".":
            counter += 1
        if S[row][col1] == "." and S[row][col2] == "#":
            end = col2
            for i in range(start, end):
                Lamp_row[row][i] = counter
            counter = 0
#print(*Lamp_row, sep="\n")
#print() col1 range(w + 1) range w + 1 w 1 col2 = col1 + 1 col2 col1 + 1 col1 1 if S[row][col1] == "#" and S[row][col2] == ".":
            start = col2
            counter += 1
         S[row][col1] == "#" and S[row][col2] == "." S[row][col1] == "#" S[row][col1] [row] S row col1 "#" S[row][col2] == "." S[row][col2] [row] S row col2 "." start = col2 start col2 counter += 1 counter 1 if S[row][col1] == "." and S[row][col2] == ".":
            counter += 1
         S[row][col1] == "." and S[row][col2] == "." S[row][col1] == "." S[row][col1] [row] S row col1 "." S[row][col2] == "." S[row][col2] [row] S row col2 "." counter += 1 counter 1 if S[row][col1] == "." and S[row][col2] == "#":
            end = col2
            for i in range(start, end):
                Lamp_row[row][i] = counter
            counter = 0
#print(*Lamp_row, sep="\n")
#print() S[row][col1] == "." and S[row][col2] == "#" S[row][col1] == "." S[row][col1] [row] S row col1 "." S[row][col2] == "#" S[row][col2] [row] S row col2 "#" end = col2 end col2 for i in range(start, end):
                Lamp_row[row][i] = counter
             i range(start, end) range start end Lamp_row[row][i] = counter Lamp_row[row][i] [row] Lamp_row row i counter counter = 0 counter 0 for col in range(w + 2):
    counter = 0
    for row1 in range(h + 1):
        row2 = row1 + 1
        if S[row1][col] == "#" and S[row2][col] == ".":
            start = row2
            counter += 1
        if S[row1][col] == "." and S[row2][col] == ".":
            counter += 1
        if S[row1][col] == "." and S[row2][col] == "#":
            end = row2
            for i in range(start, end):
                Lamp_col[i][col] = counter
            counter = 0
#print(*Lamp_col, sep="\n") col range(w + 2) range w + 2 w 2 counter = 0 counter 0 for row1 in range(h + 1):
        row2 = row1 + 1
        if S[row1][col] == "#" and S[row2][col] == ".":
            start = row2
            counter += 1
        if S[row1][col] == "." and S[row2][col] == ".":
            counter += 1
        if S[row1][col] == "." and S[row2][col] == "#":
            end = row2
            for i in range(start, end):
                Lamp_col[i][col] = counter
            counter = 0
#print(*Lamp_col, sep="\n") row1 range(h + 1) range h + 1 h 1 row2 = row1 + 1 row2 row1 + 1 row1 1 if S[row1][col] == "#" and S[row2][col] == ".":
            start = row2
            counter += 1
         S[row1][col] == "#" and S[row2][col] == "." S[row1][col] == "#" S[row1][col] [row1] S row1 col "#" S[row2][col] == "." S[row2][col] [row2] S row2 col "." start = row2 start row2 counter += 1 counter 1 if S[row1][col] == "." and S[row2][col] == ".":
            counter += 1
         S[row1][col] == "." and S[row2][col] == "." S[row1][col] == "." S[row1][col] [row1] S row1 col "." S[row2][col] == "." S[row2][col] [row2] S row2 col "." counter += 1 counter 1 if S[row1][col] == "." and S[row2][col] == "#":
            end = row2
            for i in range(start, end):
                Lamp_col[i][col] = counter
            counter = 0
#print(*Lamp_col, sep="\n") S[row1][col] == "." and S[row2][col] == "#" S[row1][col] == "." S[row1][col] [row1] S row1 col "." S[row2][col] == "#" S[row2][col] [row2] S row2 col "#" end = row2 end row2 for i in range(start, end):
                Lamp_col[i][col] = counter
             i range(start, end) range start end Lamp_col[i][col] = counter Lamp_col[i][col] [i] Lamp_col i col counter counter = 0 counter 0 max_sum = 0 max_sum 0 for row in range(h+2):
    for col in range(w+2):
        max_sum = max(max_sum, Lamp_row[row][col] + Lamp_col[row][col] - 1) row range(h+2) range h+2 h 2 for col in range(w+2):
        max_sum = max(max_sum, Lamp_row[row][col] + Lamp_col[row][col] - 1) col range(w+2) range w+2 w 2 max_sum = max(max_sum, Lamp_row[row][col] + Lamp_col[row][col] - 1) max_sum max(max_sum, Lamp_row[row][col] + Lamp_col[row][col] - 1) max max_sum Lamp_row[row][col] + Lamp_col[row][col] - 1 Lamp_row[row][col] + Lamp_col[row][col] Lamp_row[row][col] [row] Lamp_row row col Lamp_col[row][col] [row] Lamp_col row col 1 print(max_sum) print max_sum counter = 0 0 counter Lamp_col = [[0 for i in range(w+2)] for j in range(h+2)] [[0 for i in range(w+2)] for j in range(h+2)] Lamp_col col2 = col1 + 1 col1 + 1 col2 row2 = row1 + 1 row1 + 1 row2 counter += 1 1 counter end = col2 col2 end counter = 0 0 counter h, w = map(int, input().split()) map(int, input().split()) h counter += 1 1 counter start = row2 row2 start Lamp_row = [[0 for i in range(w+2)] for j in range(h+2)] [[0 for i in range(w+2)] for j in range(h+2)] Lamp_row end = row2 row2 end counter = 0 0 counter counter += 1 1 counter w = map(int, input().split()) map(int, input().split()) w S = [["#"] * (w + 2)] [["#"] * (w + 2)] S counter = 0 0 counter counter += 1 1 counter start = col2 col2 start max_sum = 0 0 max_sum max_sum = max(max_sum, Lamp_row[row][col] + Lamp_col[row][col] - 1) max(max_sum, Lamp_row[row][col] + Lamp_col[row][col] - 1) max_sum
h, w = map(int, input().split())
S = [["#"] * (w + 2)]
for i in range(h):
    S.append(["#"] + list(input()) + ["#"])
S.append(["#"] * (w + 2))
Lamp_row = [[0 for i in range(w+2)] for j in range(h+2)]
Lamp_col = [[0 for i in range(w+2)] for j in range(h+2)]
#print(S)

for row in range(h + 2):
    counter = 0
    for col1 in range(w + 1):
        col2 = col1 + 1
        if S[row][col1] == "#" and S[row][col2] == ".":
            start = col2
            counter += 1
        if S[row][col1] == "." and S[row][col2] == ".":
            counter += 1
        if S[row][col1] == "." and S[row][col2] == "#":
            end = col2
            for i in range(start, end):
                Lamp_row[row][i] = counter
            counter = 0
#print(*Lamp_row, sep="\n")
#print()

for col in range(w + 2):
    counter = 0
    for row1 in range(h + 1):
        row2 = row1 + 1
        if S[row1][col] == "#" and S[row2][col] == ".":
            start = row2
            counter += 1
        if S[row1][col] == "." and S[row2][col] == ".":
            counter += 1
        if S[row1][col] == "." and S[row2][col] == "#":
            end = row2
            for i in range(start, end):
                Lamp_col[i][col] = counter
            counter = 0
#print(*Lamp_col, sep="\n")

max_sum = 0
for row in range(h+2):
    for col in range(w+2):
        max_sum = max(max_sum, Lamp_row[row][col] + Lamp_col[row][col] - 1)
print(max_sum)