n=int(input())
s=list(input())
count=0
if "#" not in s or "." not in s:
    print(0)
else:
    for i in range(n-1):
        if s[i]=="#" and s[i+1]==".":
            s.pop(i+1)
            s.insert(i+1,"#")
            count+=1
    print(count)
        