N = int(input())
S = list(input())
def check(N, S):
    ls = []
    for i in range(N - 1):
        if S[i] == "#" and S[i + 1] == ".":
                ls.append(True)
        else:
            ls.append(False)
    return ls.count(True)

def change(N, S):
    cnts = []
    for i in range(1, N):
        form = S[:i]
        latt = S[i:]
        cnt = 0
        if form.count(".") >= form.count("#"):
            cnt += form.count("#")
        if form.count(".") < form.count("#"):
            cnt += form.count(".")
        cnt += latt.count("#")
        cnts.append(cnt)
    return cnts

if check(N, S) == 0:
    print(0)
else:
    print(min(change(N, S)))
