def resolve():
    n = int(input())
    s = input()
    if len(set(s)) == 1:
        print(0)
    else:
        acc_w, acc_b = [], []
        w, b = 0, 0
        for i in range(n):
            if s[i] == ".":
                w += 1
            else:
                b += 1
            acc_w.append(w)
            acc_b.append(b)
        ans = min(s.count("."), s.count("#"))
        for i in range(n - 1):
            if s[i] == "." and s[i + 1] == "#":
                t = acc_b[i + 1] + acc_w[n - 1] - acc_w[i]
                if t < ans:
                    ans = t
        print(ans)


if __name__ == "__main__":
    resolve()
