H,W = map(int, input().split())

S_array = [["#" for _ in range(W+2)]] + [["#"] + list(input()) + ["#"] for i in range(H)] + [["#" for _ in range(W+2)]]

def connection_check(target_list):
    connection = 0
    connection_list = list()
    
    for i in range(len(target_list)):
        if target_list[i]=="#":
            connection_list += [connection for _ in range(connection)]
            connection_list += [0]
            connection = 0
        elif target_list[i]==".":
            connection += 1
    
    return connection_list

W_connection_array = [[0 for _ in range(W+2)]] + [connection_check(S_array[i]) for i in range(1,H+1)] + [[0 for _ in range(W+2)]]
H_connection_array = [[0 for _ in range(H+2)]] + [connection_check([row[i] for row in S_array]) for i in range(1,W+1)] + [[0 for _ in range(H+2)]]

#print(W_connection_array)
#print(H_connection_array)

ans = 0

for i in range(1,H+1):
    for j in range(1,W+1):
        temp_ans = W_connection_array[i][j] + H_connection_array[j][i]
        if ans < temp_ans:
            ans = temp_ans

print(ans - 1) #自分自身の分の重複加算を引く H,W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W ["#"] + list(input()) + ["#"] for i in range(H) for i in range(H) i range(H) range H for i in range(H) ["#"] + list(input()) + ["#"] ["#"] + list(input()) ["#"] "#" list(input()) list input() input ["#"] "#" S_array = [["#" for _ in range(W+2)]] + [["#"] + list(input()) + ["#"] for i in range(H)] + [["#" for _ in range(W+2)]] S_array [["#" for _ in range(W+2)]] + [["#"] + list(input()) + ["#"] for i in range(H)] + [["#" for _ in range(W+2)]] [["#" for _ in range(W+2)]] + [["#"] + list(input()) + ["#"] for i in range(H)] [["#" for _ in range(W+2)]] ["#" for _ in range(W+2)] [["#"] + list(input()) + ["#"] for i in range(H)] [["#" for _ in range(W+2)]] ["#" for _ in range(W+2)] def connection_check(target_list):
    connection = 0
    connection_list = list()
    
    for i in range(len(target_list)):
        if target_list[i]=="#":
            connection_list += [connection for _ in range(connection)]
            connection_list += [0]
            connection = 0
        elif target_list[i]==".":
            connection += 1
    
    return connection_list connection_check connection = 0 connection 0 connection_list = list() connection_list list() list for i in range(len(target_list)):
        if target_list[i]=="#":
            connection_list += [connection for _ in range(connection)]
            connection_list += [0]
            connection = 0
        elif target_list[i]==".":
            connection += 1
    
     i range(len(target_list)) range len(target_list) len target_list if target_list[i]=="#":
            connection_list += [connection for _ in range(connection)]
            connection_list += [0]
            connection = 0
        elif target_list[i]==".":
            connection += 1
    
     target_list[i]=="#" target_list[i] target_list i "#" connection for _ in range(connection) for _ in range(connection) _ range(connection) range connection for _ in range(connection) connection connection_list += [connection for _ in range(connection)] connection_list [connection for _ in range(connection)] connection_list += [0] connection_list [0] 0 connection = 0 connection 0 elif target_list[i]==".":
            connection += 1
    
     target_list[i]=="." target_list[i] target_list i "." connection += 1 connection 1 return connection_list connection_list target_list target_list connection_check(S_array[i]) for i in range(1,H+1) for i in range(1,H+1) i range(1,H+1) range 1 H+1 H 1 for i in range(1,H+1) connection_check(S_array[i]) connection_check S_array[i] S_array i W_connection_array = [[0 for _ in range(W+2)]] + [connection_check(S_array[i]) for i in range(1,H+1)] + [[0 for _ in range(W+2)]] W_connection_array [[0 for _ in range(W+2)]] + [connection_check(S_array[i]) for i in range(1,H+1)] + [[0 for _ in range(W+2)]] [[0 for _ in range(W+2)]] + [connection_check(S_array[i]) for i in range(1,H+1)] [[0 for _ in range(W+2)]] [0 for _ in range(W+2)] [connection_check(S_array[i]) for i in range(1,H+1)] [[0 for _ in range(W+2)]] [0 for _ in range(W+2)] connection_check([row[i] for row in S_array]) for i in range(1,W+1) for i in range(1,W+1) i range(1,W+1) range 1 W+1 W 1 for i in range(1,W+1) connection_check([row[i] for row in S_array]) connection_check [row[i] for row in S_array] H_connection_array = [[0 for _ in range(H+2)]] + [connection_check([row[i] for row in S_array]) for i in range(1,W+1)] + [[0 for _ in range(H+2)]] H_connection_array [[0 for _ in range(H+2)]] + [connection_check([row[i] for row in S_array]) for i in range(1,W+1)] + [[0 for _ in range(H+2)]] [[0 for _ in range(H+2)]] + [connection_check([row[i] for row in S_array]) for i in range(1,W+1)] [[0 for _ in range(H+2)]] [0 for _ in range(H+2)] [connection_check([row[i] for row in S_array]) for i in range(1,W+1)] [[0 for _ in range(H+2)]] [0 for _ in range(H+2)] ans = 0 ans 0 for i in range(1,H+1):
    for j in range(1,W+1):
        temp_ans = W_connection_array[i][j] + H_connection_array[j][i]
        if ans < temp_ans:
            ans = temp_ans i range(1,H+1) range 1 H+1 H 1 for j in range(1,W+1):
        temp_ans = W_connection_array[i][j] + H_connection_array[j][i]
        if ans < temp_ans:
            ans = temp_ans j range(1,W+1) range 1 W+1 W 1 temp_ans = W_connection_array[i][j] + H_connection_array[j][i] temp_ans W_connection_array[i][j] + H_connection_array[j][i] W_connection_array[i][j] [i] W_connection_array i j H_connection_array[j][i] [j] H_connection_array j i if ans < temp_ans:
            ans = temp_ans ans < temp_ans ans temp_ans ans = temp_ans ans temp_ans print(ans - 1) print ans - 1 ans 1 temp_ans = W_connection_array[i][j] + H_connection_array[j][i] W_connection_array[i][j] + H_connection_array[j][i] temp_ans ans = 0 0 ans W_connection_array = [[0 for _ in range(W+2)]] + [connection_check(S_array[i]) for i in range(1,H+1)] + [[0 for _ in range(W+2)]] [[0 for _ in range(W+2)]] + [connection_check(S_array[i]) for i in range(1,H+1)] + [[0 for _ in range(W+2)]] W_connection_array H_connection_array = [[0 for _ in range(H+2)]] + [connection_check([row[i] for row in S_array]) for i in range(1,W+1)] + [[0 for _ in range(H+2)]] [[0 for _ in range(H+2)]] + [connection_check([row[i] for row in S_array]) for i in range(1,W+1)] + [[0 for _ in range(H+2)]] H_connection_array H,W = map(int, input().split()) map(int, input().split()) H def connection_check(target_list):
    connection = 0
    connection_list = list()
    
    for i in range(len(target_list)):
        if target_list[i]=="#":
            connection_list += [connection for _ in range(connection)]
            connection_list += [0]
            connection = 0
        elif target_list[i]==".":
            connection += 1
    
    return connection_list def connection_check(target_list):
    connection = 0
    connection_list = list()
    
    for i in range(len(target_list)):
        if target_list[i]=="#":
            connection_list += [connection for _ in range(connection)]
            connection_list += [0]
            connection = 0
        elif target_list[i]==".":
            connection += 1
    
    return connection_list connection_check S_array = [["#" for _ in range(W+2)]] + [["#"] + list(input()) + ["#"] for i in range(H)] + [["#" for _ in range(W+2)]] [["#" for _ in range(W+2)]] + [["#"] + list(input()) + ["#"] for i in range(H)] + [["#" for _ in range(W+2)]] S_array ans = temp_ans temp_ans ans W = map(int, input().split()) map(int, input().split()) W
H,W = map(int, input().split())

S_array = [["#" for _ in range(W+2)]] + [["#"] + list(input()) + ["#"] for i in range(H)] + [["#" for _ in range(W+2)]]

def connection_check(target_list):
    connection = 0
    connection_list = list()
    
    for i in range(len(target_list)):
        if target_list[i]=="#":
            connection_list += [connection for _ in range(connection)]
            connection_list += [0]
            connection = 0
        elif target_list[i]==".":
            connection += 1
    
    return connection_list

W_connection_array = [[0 for _ in range(W+2)]] + [connection_check(S_array[i]) for i in range(1,H+1)] + [[0 for _ in range(W+2)]]
H_connection_array = [[0 for _ in range(H+2)]] + [connection_check([row[i] for row in S_array]) for i in range(1,W+1)] + [[0 for _ in range(H+2)]]

#print(W_connection_array)
#print(H_connection_array)

ans = 0

for i in range(1,H+1):
    for j in range(1,W+1):
        temp_ans = W_connection_array[i][j] + H_connection_array[j][i]
        if ans < temp_ans:
            ans = temp_ans

print(ans - 1) #自分自身の分の重複加算を引く