N = int(input())
S = input()
ans = 2*10**5+1
tmp = 0

S_list = list(S)
S_list.insert(0,"+")
S_list.insert(N+1,"+")

for i in reversed(range(1,N+1)):
    if (S_list[i] == "."):
        for j in range(0,i):
            if (S_list[j] == "#"):
                tmp += 1
        for j in range(i+1,len(S_list)):
            if (S_list[j] == "."):
                tmp += 1
        print(tmp)
        if tmp < ans :
            ans = tmp
            tmp = 0

print(ans)
