n = int(input())
s = list(input())
if "#" in s:
    def my_index(l, x):
        return [i for i, _x in enumerate(l) if _x == x]
    if len(my_index(s,"#")) > 1:
        m = my_index(s,"#")
        print(min(s[m[0] + 1:].count("."),s[m[0] + 1:].count("#"),s[m[1] + 1:].count(".") + 1))
    else:
        k = s.index("#")
        print(0 if k == n-1 else min(s[k+1:].count("."),s[k+1:].count("#") + 1))
else:
    print(0)