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

i=0
while s[0]==".":
    s=s[1:]
    if s=="":
        print(0)
        exit()

while s[-1]=="#":
  s=s[:-1]
  if s=="":
    print(0)
    exit()

#print(s)
print(min(s.count("."),s.count("#")))

  
