n=int(input()) 
s=list(input())

ans=2000000
cnt=0
for i in range(n):
  for j in range(n-i):
    if s[i+j]==".":
      cnt+=1
  for k in range(i):
    if s[k]=="#":
      cnt+=1
  if cnt<=ans:
    ans=cnt
  cnt=0

for i in range(n):
  if s[i]==".":
    cnt+=1
  else:
    cnt-=1

if abs(cnt)==len(s):
  ans=0

print(ans)
