N = int(input())
S = str(input())

white = 0
black = 0
first_black_index = 0
end_index = N

while S[first_black_index] == ".":
  first_black_index += 1
  if first_black_index == N:
    print(0)
    break

last_black_index = len(S)
if first_black_index != N:
  while S[len(S)] == "#":
    last_black_index -= 1
    if last_black_index == 0:
      print(0)
      break


if first_black_index != N and last_black_index != 0:
  S = S[first_black_index:last_black_index+1]

  for i in range(len(S)):
    if S[i] == "#":
      black +=1
    else:
      white +=1

  print(min(white,black))
