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

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