n = int(input())
s = input()

start = len(s)
frag = False
i = 0
kuro = 0
while(i<len(s)):
    if(s[i]=="#" and not(frag)):
        frag = True
        start = i
        i += 1
        kuro += 1
    elif(s[i]=="." and frag):
        start = i - 1
        i = len(s)
    elif(frag):
        kuro += 1
        i += 1
    else:
        i += 1

if(start == len(s)):
    print("0")
else:
    shiro = 0
    for i in range(len(s)-start-1):
        if(s[i+start+1]=="."):
            shiro += 1
        else:
            kuro += 1
    if(kuro<=shiro):
        if(s[len(s)-1]=="#"):
            print(kuro-1)
        else:
            print(kuro)
    else:
        print(shiro)