import collections
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:]
            counter = collections.Counter(S_right)
            count = counter["#"]
            count_ = counter["."]
            break

print(min(count,count_))