Buggy python submission (verdict: Time Limit Exceeded):
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) #自分自身の分の重複加算を引く

Fixed submission:
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) #自分自身の分の重複加算を引く

Buggy python submission (verdict: Runtime Error):
#129d
H,W = map(int, input().split()) #H,W<=2000≒2*10^3
#∴最大で4*10^6…シンプルな処理でないと死ぬ。

input_2d = [[None] * W for _ in range(H)]

processed_input_2d_w = [[None] * W for _ in range(H)]
processed_input_2d_h = [[None] * H for _ in range(W)]

ans = 0

def cont_quantificate(seq_list):
    stored_char = seq_list[0]
    stored_index = 0
    stored_count = 1
    
    ans = []
    
    if len(seq_list)!=1:
        for i in range(1,len(seq_list)):
            
            if seq_list[i] == stored_char:
                stored_count += 1
                
            else:
                if stored_char != "#":
                    ans.extend([stored_count for _ in range(stored_count)])
                    stored_count = 1
                    stored_char = seq_list[i]
                else:
                    ans.extend([0 for _ in range(stored_count)])
                    stored_count = 1
                    stored_char = seq_list[i]
                    
        if stored_char != "#":
            ans.extend([stored_count for _ in range(stored_count)])
        else:
            ans.extend([0 for _ in range(stored_count)]) 
            
        return ans
    else:
        if stored_char != "#":
            ans = [1]
        else:
            ans = [0]
        return ans

#読み込みつつ、横方向の処理
for i in range(H):
    #読み込み
    input_row = str(input())
    input_2d[i] = [input_row[i] for i in range(len(input_row))]
    #横方向で連続している数を求める
    processed_input_2d_w[i] = cont_quantificate(input_row)

print("input")
print(input_2d)
print("横方向")
print(processed_input_2d_w)
    
#縦方向に処理する
for i in range(W):
    #縦方向で連続している数を求める
    processed_input_2d_h[i] = cont_quantificate([row[i] for row in input_2d])
    
print("縦方向")
print(processed_input_2d_h)

#回答を求める
for i in range(H):
    for j in range(W):
        ans[i][j] = processed_input_2d_w[i][j] + processed_input_2d_h[j][i]
        
print(ans)

Fixed submission:
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) #自分自身の分の重複加算を引く