output_description: Print the minimum possible sum of the flight times.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      P Q R
attempt: import copy
  
  H, W = map(int, input().split())
  state = []
  for i in range(H):
      row_list = list(input())
      state.append(row_list)
  
  
  def light(row, col, state):
      lighted_count = 0
      col1 = copy.copy(col)
      next = "."
      while next == ".":
          lighted_count += 1
          col1 += 1
          if col1 >= W:
              break
          next = state[row][col1]
  
      col2 = copy.copy(col)
      next = "."
      while next == ".":
          lighted_count += 1
          col2 -= 1
          if col2 < 0:
              break
          next = state[row][col2]
  
      row1 = copy.copy(row)
      next = "."
      while next == ".":
          lighted_count += 1
          row1 += 1
          if row1 >= H:
              break
          next = state[row1][col]
  
      row2 = copy.copy(row)
      next = "."
      while next == ".":
          lighted_count += 1
          row2 -= 1
          if row2 < 0:
              break
          next = state[row2][col]
  
      lighted_count -= 3
      return lighted_count
  
  
  def blank_fun(state):
      blank_list = []
      for h in range(H):
          for w in range(W):
              if state[h][w] == ".":
                  blank_list.append([h, w])
      return blank_list
  
  
  blank_list = blank_fun(state)
  blank_count = 0
  for blank in blank_list:
      row = blank[0]
      col = blank[1]
      blank_count_now = light(row, col, state)
  
      if blank_count_now > blank_count:
          blank_count = blank_count_now
  
  
  print(blank_count)
  
problem_description: Statement
  
  There are three airports A, B and C, and flights between each pair of airports
  in both directions.
  
  A one-way flight between airports A and B takes P hours, a one-way flight
  between airports B and C takes Q hours, and a one-way flight between airports
  C and A takes R hours.
  
  Consider a route where we start at one of the airports, fly to another airport
  and then fly to the other airport.
  
  What is the minimum possible sum of the flight times?
samples: [{"input": "1 3 4", "output": "4\n    \n\n  * The sum of the flight times in the route A \\rightarrow B \\rightarrow C: 1 + 3 = 4 hours\n  * The sum of the flight times in the route A \\rightarrow C \\rightarrow C: 4 + 3 = 7 hours\n  * The sum of the flight times in the route B \\rightarrow A \\rightarrow C: 1 + 4 = 5 hours\n  * The sum of the flight times in the route B \\rightarrow C \\rightarrow A: 3 + 4 = 7 hours\n  * The sum of the flight times in the route C \\rightarrow A \\rightarrow B: 4 + 1 = 5 hours\n  * The sum of the flight times in the route C \\rightarrow B \\rightarrow A: 3 + 1 = 4 hours\n\nThe minimum of these is 4 hours.\n\n* * *"}, {"input": "3 2 3", "output": "5"}]