a = int(input())
b = input()
 
wh = 0
br = 0

for i in range(a):
  if(b[i] == '.'):
    wh += 1
    
tmp = a

if(wh != 0):
  for i in range(a):
    if(b[i] == '#'):
      br += 1
    else:
      wh -= 1
    if(tmp > br + wh):
      tmp = br + wh
else:
  tmp = 0
print(tmp)