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

start = len(s)
i = 0
while(i<len(s)):
    if(s[i]=="#"):
        start = i
        i = len(s)
    else:
        i += 1

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