from collections import deque
n=int(input())
s=input()
black=0
write=s.count(".")
koho=deque([])
for i in s:
    if i==".":
        write-=1
    else:
        black+=1
    koho.append(write+black)
print(min(koho))