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

white = 0
black = 0
first_black_index = 0
last_white_index = N

for i in range(N):
  if S[i] == ".":
    first_black_index = i + 1
  else:
    break

for i in range(N):
  if S[N-i-1] == "#":
    last_white_index = N-i
  else:
    break

if first_black_index != N :
  S = S[first_black_index:last_white_index]

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