n=int(input())
s=input()
a=False
b=False
ans1=0
ans2=0
for i in range(n):
    if s[i]=='#':
        a=True
    if s[i]=='.' and a:
        ans1+=1
    if s[n-1-i]=='.':
        b=True
    if s[n-i-1]=='#' and b:
        ans2+=1
print(min(ans1,ans2))