lw = 0
fw = 0
cb=0
cw=0
n = int(input())
s = input()

for i in reversed(range(n)):
    if s[i]==".":
        lw=i
        break
for i in range(n):
    if s[i]=="#":
        fw=i
        break

for i in range(fw,lw+1):
    if s[i]=="#":
        cb+=1
    elif s[i]==".":
        cw+=1
        
print(min(cb, cw))