n=int(input())
a=list(input())
b=[]

for i in range(1,n):
  if (a[i]=="#" and a[i-1]=="."):
  	b.append(a[:i].count("#")+a[i:].count("."))

b.append(a.count("."))
b.append(a.count("#"))

print(min(b))