n = int(input())
s = input()

if s == "." * n:
    print(0)
else:
    black = s.index("#")
    white = [i for i, x in enumerate(s) if x == "."]
    wb = [i for i, x in enumerate(s[black:]) if x == "."]
    bw = [i for i, x in enumerate(s[:white[-1]]) if x == "#"]
    print(min(len(wb), len(bw)))