n=int(input())
s=input()
switch=False
ans=0
for i in s:
    if switch==False:
        if i=="#":
            switch=True
    else:
        if i==".":
            ans+=1
switch=False
cnt=0
for i in s[::-1]:
    if switch==False:
        if i==".":
            switch=True
    else:
        if i=="#":
            cnt+=1
print(min(ans,cnt))