N = int(input())
S = input()
c1 = 0
for i in range(N - 1, -1, -1):
    if S[i] == ".":
        c1 = i
        break
c2 = N - 1
for i in range(N - 1, -1, -1):
    if S[i] == '#':
        c2 = i
        break
a = S[:c2 + 1].count('#') + S[c2:].count('.')
b = S.count("#")
c = S.count(".")
ans = min(a, b, c)
print(ans)