n = int(input())
s = list(input())
b = [s[i:].count(".") for i in range(n)]
c = [s[:i-1].count("#") for i in range(n)]
a = [b[i]+c[i] for i in range(n)]
if "." not in s:
    a.append(0)
elif "#" not in s:
    a.append(0)
print(min(a))