N = int(input())
S = input()
if S == '.' * N:
  print(0)
else:
  first = 0
  for i in range(1,N+1):
    if S[i-1] == '#':
      first = i
      break
  out1 = 0
  for i in range(first+1,N+1):
    if S[i-1] =='.':
      out1 += 1
  out2 = 0
  for i in range(1,N+1):
    if S[i-1] == '#':
      out2 += 1
  print(min(out1,out2,N-out2))