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