N,S = open(0).read().split()
N=int(N)
S=list(S)

def calc():
    l = len(S)
    i = 0
    g = []
    while i < l:
        w = b = 0
        while i+w < l and S[i+w] == '.': w += 1
        while i+w+b < l and S[i+w+b] == '#': b += 1
        g.append(w)
        g.append(b)
        i += w + b

    i = 1
    j = len(g) - 2
    cnt = 0
    while i < j:
        if g[i+1] > g[j-1]:
            cnt += g[i]
            i += 2
        else:
            cnt += g[j]
            j -= 2
    return cnt

all_w = sum([1 if s == '#' else 0 for s in S])
all_b = sum([1 if s == '.' else 0 for s in S])
lwrb = calc()
print(min(all_w, all_b, lwrb))