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

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

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