from sys import stdin

n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()

flag = 0
countWhite = 0 
for i in range(n):
  if ( s[i] == '#' ):
    flag = 1
  if ( flag == 1 and s[i] == '.' ):
    countWhite += 1

flag = 0
countBlack = 0 
for i in range(n):
  if ( s[n-1-i] == '.' ):
    flag = 1
  if ( flag == 1 and s[n-1-i] == '#' ):
    countBlack += 1

if (countWhite<countBlack) :
  ans = countWhite 
else :
  ans = countBlack 

print(ans)
