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


if __name__ == "__main__":
    resolve()
