n=int(input())
s=input()
def is_all(s):
    for i in range(1,len(s)):
        if s[i]!=s[i-1]:
            return False
    return True
if is_all(s):
    print(0)
    exit()
for i in range(n):
    if s[i]=="#":
        l=i
        break
for i in range(n-1,-1,-1):
    if s[i]==".":
        r=i
        break
a,b=1,0 # a:'.'の個数 b:'#'の個数
for i in range(l,r):
    if s[i]==".":
        a+=1
    else:
        b+=1
print(min(a,b))