from collections import Counter
N = int(input())
S = list(input())
ans = Counter(S)
ans = min(ans["#"], ans["."])
kuro = 0
for i in range(N-1, -1, -1):
    if S[i] == ".":
        for j in range(i-1, -1, -1):
            kuro += S[j] == "#"
    else:
        continue
    break
print(min(ans, kuro))
