def solve_max_square(arr, sz)
  maxWidth = 0
  pos = {}
  sz.times{|i|
    sz.times{|j|
      pos[i*sz+j] = 1 if arr[i][j] == "."
    }
  }
  w = {}
  sz.times{|i|
    w[i] = 0
    w[i] = 1 if arr[i][0] == "."
    w[i*sz] = 0
    w[i*sz] = 1 if arr[0][i] == "."
  }
  pos.each_key{|it|
    if w[it-sz-1] && w[it-1] && w[it-sz] then
      min = w[it-sz-1] < w[it-1] ? w[it-sz-1] : w[it-1]
      w[it] = min < w[it-sz] ? min + 1 : w[it-sz] + 1
      maxWidth = maxWidth > w[it] ? maxWidth : w[it]
    else
      w[it] = 1
    end
  }
  return maxWidth
end

while n = gets.to_i
  break if n == 0
  arr = []
  n.times{|i|
    arr[i] = gets.chomp.split("")
  }
  p solve_max_square(arr,n)
end