def solve(n, s):
    l = 0
    r = n-1
    while l < n:
        if s[l] == "#":
            break
        l += 1
    while 0 <= r:
        if s[r] == ".":
            break
        r -= 1
    t = s[l:r+1]
    return min(t.count("."), t.count("#"))

assert solve(3, "#.#") == 1
assert solve(5, "#.##.") == 2
assert solve(9, ".........") == 0

n = int(input())
s = input()
print(solve(n, s))