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

ans = 0
answ = 0
ansb = 1
c = 0

for i in range(n):
    if s[i] == "#":
        c = 1
        break

if c == 0:
    print(0)

else:

    for i in range(n):

        if s[i] == "#":

            for j in range(n-i-1):
                
                if s[i+1+j] == ".":
                    answ += 1
                else:
                    ansb += 1

            if ansb <= answ:
                ans = ansb
            else:
                ans = answ   
                
            print(ans)
            break