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

print(min(count,count_))