n = input()
s = input()
if (s.count("#") == len(s)) or (s.count(".") == len(s)):
    print(0)
else:
    sharp_cnt = s.count("#")
    # print(s.count("#"))
    if s[len(s)-1] == "#":
        for i in reversed(range(0,len(s))):
            if s[i] == ".":
                x = len(s)-i-1
                break
        sharp_cnt -= x

    period_cnt = s.count(".")
    if s[0] == ".":
        for i in range(len(s)):
            if s[i] == "#":
                y = i
                break
        period_cnt -= y
    print(min(period_cnt,sharp_cnt))