n = int(input().strip())
s = input().strip()
 
array=[]

for j in range(n):
  cnt = 0
  for i in range(j):
    if s[i] != ".":
      cnt += 1
  for i in range(j+1,n):
    if s[i] != "#":
      cnt += 1
  array.append(cnt)
  
  

print(min(array))

