n = int(input())
s = str(input())
cd = 0 ; dh = 0; ok = False
for i in range(0 , len(s)):
  if(s[i] == '#'):
    ok = True; dh += 1;
  if(ok and s[i] == '.'):
    cd += 1
sr = s[::-1]
xd = 0 ; xr = 0
for i in range(0 , len(sr)):
  if(sr[i] == '#'):
    xd += 1
  else:
    break
print(min(cd , dh - xd))