from numpy import cumsum

N = int(input())
S = input()
ss = S.replace("#", "1").replace(".", "0")
* ls, = map(int, ss)
cum_ls = cumsum(ls)

ans = 10**10
for i in range(1, N-1):
    ans = min(ans, cum_ls[i] + (N-(i+1) - (cum_ls[-1] - cum_ls[i])))

print(min(ans, S.count("#"), S.count(".")))
