n=int(input())
s=input()
if all([s[i]=="#" for i in range(n)]):
    print(0)
    exit()
if all([s[i]=="." for i in range(n)]):
    print(0)
    exit()
try:
    a=s[::-1].index("#")
    b=s.index("#")
    c=s[::-1].index(".")
except:a=b=0
print(b,c,n)
if b+c==n:
    print(0)
    exit()
count=0
for i in range(b+1,n-a):
    if s[i]=="#":count+=1
print(min(count,s.count("#"),s.count(".")))