N = int(input())
S = list(input())
memo = 0
count = 0
if "#" in S:
    for i in range(N):
        if S[i] == "#":
            memo = i
            #S_right = S[i+1:]
            break
    for j in range(i,N):
        if S[j] == ".":
            S_right = S[memo:]
            count = S_right.count(".")
            count_ = S_right.count("#")
            break

print(min(count,count_))